def process(self, tick_data): MovingState.process(self, tick_data) if self.entity.collides_with_player(): if self.entity.is_hit_by_player(): self.entity.bounce_player(tick_data) self.entity.play_sound_relative(assets.sounds.turtle.hit) return 'shell' self.entity.hit_player(tick_data) return 'walk'
def process(self, tick_data): MovingState.process(self, tick_data) self.counter += tick_data['time_passed'] if self.counter > self.max_flat_time: return 'walk' if self.entity.collides_with_player(): if self.entity.is_hit_by_player(): self.entity.bounce_player(tick_data) self.entity.play_sound_relative(assets.sounds.krush.hit) self.counter = 0 return 'flat'
def process(self, tick_data): flipped = MovingState.process(self, tick_data) if flipped: self.entity.play_sound_relative(assets.sounds.turtle.hit_shell) if self.entity.collides_with_player(): self.entity.hit_player(tick_data) return 'shell_moving'