From: Skullheadx Date: Sat, 7 Sep 2024 02:25:54 +0000 (-0400) Subject: fix pygame.Clock() issue X-Git-Url: http://git.skullheadx.com/nixos/phil/index.html?a=commitdiff_plain;p=Electric-Dipoles.git fix pygame.Clock() issue made it pygame.time.Clock() --- diff --git a/.gitignore b/.gitignore index 854fb5e..d8d3c84 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,4 @@ cython_debug/ .idea/ .DS_Store +image.png diff --git a/main.py b/main.py index 306c9e5..870bf63 100644 --- a/main.py +++ b/main.py @@ -2,12 +2,12 @@ from particle import PointParticle from setup import * is_running = True -clock = pygame.Clock() +clock = pygame.time.Clock() delta = 0 particles = [ - PointParticle((SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2), -1.6e-19), - PointParticle((SCREEN_WIDTH / 3, SCREEN_HEIGHT / 2), 1.6e-19), + #PointParticle((SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2), -5 *1.6e-19), + PointParticle((SCREEN_WIDTH / 3, SCREEN_HEIGHT / 2), -1.6e-19), PointParticle((SCREEN_WIDTH * 2 / 3, SCREEN_HEIGHT / 2), 1.6e-19), # PointParticle((SCREEN_WIDTH / 2, SCREEN_HEIGHT * 2 / 3), 1.6e-19), # PointParticle((SCREEN_WIDTH / 2, SCREEN_HEIGHT / 3), 1.6e-19), @@ -31,4 +31,6 @@ while is_running: particle.draw(screen) pygame.display.flip() + # pygame.image.save(pygame.display.get_surface(), "image.png") + # pygame.quit() delta = clock.tick(60) diff --git a/requirements.txt b/requirements.txt index fe10527..8285a32 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ - pygame-ce \ No newline at end of file