Skip to content

Commit

Permalink
Update speed_bomb.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Chirlin committed Feb 11, 2024
1 parent 0498fb6 commit cf3430d
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions games/speed_bomb.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,26 +190,27 @@ def check_faked_out(self):
self.reset_bomb_time(True)
self.move_bomb()

# TODO - Handle the deaths better - it's pausing right now
def kill_player(self, dead_move):
self.opts[dead_move][Opts.LIVES.value] -= 1
logger.debug("Lost a life: {}, {} remaining".format(dead_move, self.opts[dead_move][Opts.LIVES.value]))
end_time = time.time() + 5
if self.play_audio:
self.explosion_death.start_effect()
self.explosion.start_effect()
while time.time() < end_time:
time.sleep(0.01)

# while time.time() < end_time:
# time.sleep(0.01)
#
# dead_color_array = self.force_move_colors[dead_move]
#
# for move_serial in self.moves:
# if move_serial == dead_move:
# colors.change_color(dead_color_array, 10, random.randrange(100, 200), 10)
# self.dead_moves[move_serial].value = Status.RUMBLE.value
# else:
# colors.change_color(self.force_move_colors[move_serial], 1, 1, 1)

self.dead_moves[dead_move].value = Status.DIED.value
dead_color_array = self.force_move_colors[dead_move]

for move_serial in self.moves:
if move_serial == dead_move:
colors.change_color(dead_color_array, 10, random.randrange(100, 200), 10)
self.dead_moves[move_serial].value = Status.RUMBLE.value
else:
colors.change_color(self.force_move_colors[move_serial], 1, 1, 1)

self.dead_moves[dead_move].value = Status.ON.value

# Reset all opts (except lives)
for move_serial in self.moves:
Expand Down

0 comments on commit cf3430d

Please sign in to comment.