mirror of
https://github.com/13hannes11/outyard-hackathon-rush-hour-co2.git
synced 2024-09-03 20:10:59 +02:00
vary speed of cars when respawning
Co-authored-by: Laura Januleviciute <januleviciute.laura@gmail.com>
This commit is contained in:
2
Car.py
2
Car.py
@@ -29,9 +29,11 @@ class Car:
|
||||
if self.directionX > 0:
|
||||
if self.posX > screen_width:
|
||||
self.posX = -self.width
|
||||
self.directionX = random.uniform(1, 5)
|
||||
else:
|
||||
if self.posX + self.width < 0:
|
||||
self.posX = screen_width + self.width
|
||||
self.directionX = -random.uniform(1, 5)
|
||||
|
||||
|
||||
if self.bubble_spawn_time_ms + self.time_of_last_spawn < pygame.time.get_ticks():
|
||||
|
||||
Reference in New Issue
Block a user