Added a speed reset on direction change and increased wobbler lifetime.

This commit is contained in:
The Wobbler 2023-07-19 16:42:25 +02:00
parent 716523c0f2
commit 0c39f7abbc

View file

@ -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()