Beispiel #1
0
 def want_move(self, direction):
     if (not self.can_take_action()):
         return
     # import ipdb; ipdb.set_trace()
     if (not hasattr(direction, 'x')):
         direction = rad2vec(direction)
     self.cancel_pending()
     self.physics.linearVelocity = (0, 0)
     self.direction = direction
     self.state = "walking"
Beispiel #2
0
	def want_move(self, direction):
		if(not self.can_take_action()):
			return
		# import ipdb; ipdb.set_trace()
		if(not hasattr(direction, 'x')):
			direction = rad2vec(direction)
		self.cancel_pending()
		self.physics.linearVelocity = (0, 0)
		self.direction = direction
		self.state = "walking"
Beispiel #3
0
    def want_attack(self, direction):
        if (not self.can_take_action()):
            return
        if (not hasattr(direction, 'x')):
            direction = rad2vec(direction)

        self.want_stop()
        self.direction = direction
        if (not hasattr(self, 'delayed_attack')
                or not self.delayed_attack.active()):
            self.delayed_attack = self.reactor.callLater(
                (12.0 / 13.0) * 0.9 * self.get_attack_speed(),
                self.commit_attack, direction)
            self.state = "shooting"
Beispiel #4
0
	def want_attack(self, direction):
		if(not self.can_take_action()):
			return
		if(not hasattr(direction, 'x')):
			direction = rad2vec(direction)

		self.want_stop()
		self.direction = direction
		if(not hasattr(self, 'delayed_attack') or not self.delayed_attack.active()):
			self.delayed_attack = self.reactor.callLater(
				(12.0/13.0)*0.9*self.get_attack_speed(),
				self.commit_attack,
				direction
			)
			self.state = "shooting"