Skip to content
Snippets Groups Projects
Commit 58870ed0 authored by Kirill Schmidt's avatar Kirill Schmidt
Browse files

Add asteroid function

parent efd48682
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,13 @@ class Game(arcade.Window):
arcade.set_background_color(arcade.color.BLACK)
# Add asteroid
def asteroid(x,y):
self.asteroid_sprite = arcade.Sprite("images/big_asteroid.png", SPRITE_SCALING)
self.all_sprites_list.append(self.player_sprite)
self.asteroid_sprite
self.asteroid_sprite.set_position(x,y)
def setup(self):
self.low_x = 0
self.low_y = 0
......@@ -46,8 +53,8 @@ class Game(arcade.Window):
self.player_sprite.set_texture(0)
self.player_sprite.left = SCREEN_WIDTH / 2 + self.player_sprite.width
self.player_sprite.bottom = SCREEN_HEIGHT / 2 + self.player_sprite.height
self.all_sprites_list.append(self.player_sprite)
self.all_sprites_list.append(self.player_sprite)
def update(self, delta_time):
if not self.slide:
self.player_sprite.change_y = self.running * SPEED * math.cos(math.radians(self.player_sprite.angle))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment