def _shoot(self, game):
from pygame.locals import K_SPACE
if self.stype and game.keystate[K_SPACE]:
u = unitVector(self.orientation)
newones = game._createSprite([self.stype], (self.lastrect.left + u[0] * self.lastrect.size[0],
self.lastrect.top + u[1] * self.lastrect.size[1]))
if len(newones) > 0 and isinstance(newones[0], OrientedSprite):
newones[0].orientation = unitVector(self.orientation)
self._reduceAmmo()
评论列表
文章目录