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

fix

parent 7d74fd11
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ ROTATE_SPEED = 4 ...@@ -18,6 +18,7 @@ ROTATE_SPEED = 4
SPRITE_SCALING = 0.4 SPRITE_SCALING = 0.4
SLIDE_SPEED = 1.05 SLIDE_SPEED = 1.05
AS_SPEED = 2 AS_SPEED = 2
CIRCLE = max(SCREEN_WIDTH, SCREEN_HEIGHT)
DISTANCE = 128 DISTANCE = 128
...@@ -50,8 +51,8 @@ class Game(arcade.Window): ...@@ -50,8 +51,8 @@ class Game(arcade.Window):
# Add asteroid # Add asteroid
def asteroid(self): def asteroid(self):
x = random.randint(int(self.player_sprite.center_x - 300), int(self.player_sprite.center_x + 300)) x = random.randint(int(self.player_sprite.center_x - CIRCLE), int(self.player_sprite.center_x + CIRCLE))
y = random.randint(int(self.player_sprite.center_y - 300), int(self.player_sprite.center_y + 300)) 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("images/big_asteroid.png", SPRITE_SCALING)
......
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