Skip to content

Commit

Permalink
Moved bullet_speed into Bullet class
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaland committed Jan 2, 2011
1 parent 68b06a6 commit 2d87036
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spaceswarm.py
Expand Up @@ -175,6 +175,7 @@ def move(self, time_passed_seconds):
class Bullet(GameObject):
image = load_image("bullet.png")
width, height = image[0].get_size()
speed = 400

def __init__(self, location):
GameObject.__init__(self, Bullet.image,
Expand Down Expand Up @@ -231,7 +232,6 @@ def instanciate_levels():

bg = load_image("bg.jpg")
clock = pygame.time.Clock()
bullet_speed = 400

# Fonts
title_font = pygame.font.SysFont(None, 48)
Expand Down Expand Up @@ -314,7 +314,7 @@ def instanciate_levels():
if game_over: break

for b in bullets:
b.move(time_passed_seconds, bullet_speed)
b.move(time_passed_seconds, Bullet.speed)

for a in aliens:
if b.location.colliderect(a.location): # alien shot down!
Expand Down

0 comments on commit 2d87036

Please sign in to comment.