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

fix

parent 1093e4d5
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,8 @@ ROTATE_SPEED = 4
SPRITE_SCALING = 0.4
SLIDE_SPEED = 1.05
DISTANCE = 128
CONTROLS = {
"run" : arcade.key.W,
"left" : arcade.key.A,
......@@ -49,7 +51,7 @@ class Game(arcade.Window):
def asteroid(self):
x = random.randint(self.view_left - 50, self.view_left + SCREEN_WIDTH + 50)
y = random.randint(self.view_bottom - 50, self.view_bottom + SCREEN_HEIGHT + 50)
if ((x - self.player_sprite.center_x) ** 2 + (y - self.player_sprite.center_y) ** 2) < 25:
if ((x - self.player_sprite.center_x) ** 2 + (y - self.player_sprite.center_y) ** 2) < (DISTANCE) ** 2:
return
asteroid_sprite = arcade.Sprite("images/big_asteroid.png", SPRITE_SCALING)
asteroid_sprite.set_position(x,y)
......
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