From 528a6ae9dafd9ac2a2c503c39ee303c7255c511b Mon Sep 17 00:00:00 2001 From: Skullheadx Date: Fri, 6 Sep 2024 22:25:54 -0400 Subject: [PATCH] fix pygame.Clock() issue made it pygame.time.Clock() --- .gitignore | 1 + main.py | 8 +++++--- requirements.txt | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) 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 -- 2.54.0