self.player_tile = None
self.nemesis_tile = None
self.timer_set = False
+ self.move_counter = 0
self.player.pos = self.level_obj.enter_pos
if platform() != 'android':
def do_nemesis_move(self):
self.nemesis.move(self.level_obj, self.player.pos)
+ self.move_counter += 1
self.check_state()
self.reset_timer()
self.draw_nemesis()
def reset_timer(self):
self.timer_set = True
Clock.unschedule(self.timed_move)
- Clock.schedule_once(self.timed_move, 0.5)
+ if self.move_counter > 4:
+ self.move_counter = 0
+ # The superhero is faster than the player
+ Clock.schedule_once(self.timed_move, 0.02)
+ else:
+ Clock.schedule_once(self.timed_move, 1)
def check_caught(self):
return self.nemesis.pos == self.player.pos
def reset_level(self):
Clock.unschedule(self.timed_move)
self.timer_set = False
+ self.move_counter = 0
if self.nemesis_tile:
self.remove_widget(self.nemesis_tile)
self.nemesis.reset_pos()
+
+ def load_level(self):
if self.level_obj:
self.level_obj.load_tiles()
self.player.pos = self.level_obj.enter_pos
if not self.level_obj:
return
if self.level_obj.at_exit(self.player.pos):
+ self.reset_level()
# Jump to next level
self.level_obj = self.level_list.advance_to_next_level()
- if not self.reset_level():
+ if not self.load_level():
self.app.game_over(True)
return
elif self.check_caught():
# Caught
+ self.reset_level()
+ self.load_level()
self.app.game_over(False)
return
elif self.level_obj.is_button(self.player.pos):