def update(self, game):
action = self._readAction(game)
if action is None:
action = (0, 0)
from pygame.locals import K_SPACE
if game.keystate[K_SPACE] and self.orientation[1] == 0:
action = (action[0] * sqrt(self.strength), -self.strength)
elif self.orientation[1] == 0 or self.airsteering:
action = (action[0] * sqrt(self.strength), 0)
else:
action = (0, 0)
self.physics.activeMovement(self, action)
VGDLSprite.update(self, game)
# ---------------------------------------------------------------------
# Termination criteria
# ---------------------------------------------------------------------
评论列表
文章目录