Skip to content

Commit

Permalink
Merge branch 'bugfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhdu committed Oct 23, 2014
2 parents 7a11921 + 20ee45c commit 9f8d583
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions game.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ def update(self):
if self.arena[y, x] == "#":
self.arena[y, x] = " "

# clear projectiles
for i in xrange(self.settings.pace):
for proj in self.projectiles: # update bullets
for proj in self.projectiles:
self.arena[proj.pos] = " "

projectiles = [Projectile(move(proj.pos, proj.direction),
Expand Down Expand Up @@ -133,12 +134,12 @@ def updateProjectile(self, proj):
self.arena[proj.pos] = render[proj.type]
self.projectiles.append(proj)
elif proj.type == "bullet":
if self.arena[proj.pos] == "*":
if self.arena[proj.pos] == "*" and self.inArena(proj.pos):
self.arena[proj.pos] = " "
elif self.arena[proj.pos] in "<>v^":
player = self.findPlayer(proj.pos)
player.hit(proj.source, proj.type)
elif proj.type == "bomb" and self.arena[proj.pos] in "#<>v^*": #explode!
elif proj.type == "bomb" and self.arena[proj.pos] in "A#<>v^*": #explode!
y, x = proj.pos

for player in self.players.values():
Expand Down

0 comments on commit 9f8d583

Please sign in to comment.