From 0c39f7abbc6853dd04908bb9899319aaa8793fc2 Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Wed, 19 Jul 2023 16:42:25 +0200 Subject: [PATCH] Added a speed reset on direction change and increased wobbler lifetime. --- screensaver.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/screensaver.py b/screensaver.py index 403fff7..b3358ff 100644 --- a/screensaver.py +++ b/screensaver.py @@ -117,13 +117,14 @@ def update(): change_rot = random.randrange(1, 101 - wobbler.speed) == 1 if change_rot: wobbler.rotation = random.randrange(0, 360) + wobbler.speed = 4 if wobbler.age < max_wobbler_size: wobbler.size += 1 wobbler.age += 1 - if wobbler.age >= 300: + if wobbler.age >= 600: wobbler.size -= 1 if wobbler.size == 0: @@ -131,6 +132,7 @@ def update(): if wobbler.x < -5 or wobbler.x > screen.get_width() + 5 or wobbler.y < -5 or wobbler.y > screen.get_height() + 5: wobbler.rotation -= 180 + wobbler.speed = 4 pygame.display.update()