Skip to content
Snippets Groups Projects
Commit 89c3b1cc authored by Jakob Kirsch's avatar Jakob Kirsch
Browse files

added small asteroids

parent 1c1f8967
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,7 @@ class Game(arcade.Window): ...@@ -58,7 +58,7 @@ class Game(arcade.Window):
y = random.randint(int(self.player_sprite.center_y - CIRCLE), int(self.player_sprite.center_y + CIRCLE)) y = random.randint(int(self.player_sprite.center_y - CIRCLE), int(self.player_sprite.center_y + CIRCLE))
if ((x - self.player_sprite.center_x) ** 2 + (y - self.player_sprite.center_y) ** 2) < (DISTANCE) ** 2: if ((x - self.player_sprite.center_x) ** 2 + (y - self.player_sprite.center_y) ** 2) < (DISTANCE) ** 2:
return return
asteroid_sprite = arcade.Sprite("images/big_asteroid.png", SPRITE_SCALING) asteroid_sprite = arcade.Sprite(random.choice(["images/big_asteroid.png"] * 3 + ["images/small_asteroid.png"] * 7), SPRITE_SCALING)
asteroid_sprite.set_position(x,y) asteroid_sprite.set_position(x,y)
asteroid_sprite.change_x = random.randint(-AS_SPEED, AS_SPEED) / 1000 asteroid_sprite.change_x = random.randint(-AS_SPEED, AS_SPEED) / 1000
asteroid_sprite.change_y = random.randint(-AS_SPEED, AS_SPEED) / 1000 asteroid_sprite.change_y = random.randint(-AS_SPEED, AS_SPEED) / 1000
...@@ -98,7 +98,7 @@ class Game(arcade.Window): ...@@ -98,7 +98,7 @@ class Game(arcade.Window):
def update(self, delta_time): def update(self, delta_time):
self.player_list.update() self.player_list.update()
self.time += 1 self.time += 1
if self.time % 100 == 0: if self.time % 50 == 0:
self.asteroid() self.asteroid()
'''for asteroid in self.asteroid_list: '''for asteroid in self.asteroid_list:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment