Ejemplo n.º 1
0
 def _state_specific(self):
     ticks = pygame.time.get_ticks()
     common.add_to_array(self.times, ticks / 1000.0)
     self.update_player_motion_disabled_period(self.player1, ticks)
     self.update_player_motion_disabled_period(self.player2, ticks)
     if self.player1.dead or self.player2.dead:
         self.state_running = False
Ejemplo n.º 2
0
    def handle_state(self, times, other):
        common.add_to_array(self.cm_array, self.center_of_mass)
        common.add_to_array(self.ap_array, self.action_point)
        common.add_to_array(self.height_array, imcompare.find_contour_height(self.contour))

        if len(times) == common.ARRAY_LEN:
            xAP, yAP, vAP, vH, h = imcompare.get_motion_params(self.cm_array, self.ap_array, self.height_array, times)
            state = imcompare.get_current_state(xAP, yAP, vAP, vH, h, self.move_state, self.crouch_height, self.hit_distance, self.hit_speed, self.high_hit_height)
            if self.move_state != state:
                self.previous_move_states += '-' + state
                self.make_move(other)
                self.move_state = state