def __init__(self): self.logger: Logger = getLogger(__name__) self.imageRotation = 0 GamePiece.__init__(self, filename=Enterprise.FILENAME) SmoothMotion.__init__(self, imageRotation=125)
def __init__(self, filename: str, coordinates: Coordinates, moveInterval: int = NEVER_MOVE_INTERVAL, scale: float = 1.0, imageRotation: int = SmoothMotion.IMAGE_ROTATION): """ Args: filename: The image file name coordinates: The game sector coordinates within the quadrant moveInterval: How often this enemy moves scale: How to scale the image imageRotation: How much to rotate image when the enemy is shooting at Captain Kirk. """ GamePiece.__init__(self, filename=filename, scale=scale) SmoothMotion.__init__(self, imageRotation=imageRotation) self.gameCoordinates = coordinates self._moveInterval: int = moveInterval self._id: EnemyId = EnemyId('IdNotSet') self._power: float = cast(float, None) self._firingInterval: int = BaseEnemy.NEVER_FIRE_INTERVAL self._lastTimeCheck: int = 0 self._timeSinceMovement: float = 0.0
def __init__(self, speed: float = 3.0): GamePiece.__init__(self, filename=PhotonTorpedo.FILENAME, speed=speed) SmoothMotion.__init__(self, imageRotation=0) self.logger: Logger = getLogger(__name__) self._id: PhotonTorpedoId = PhotonTorpedoId( f'Torpedo-{PhotonTorpedo.nextId}') self._firedAt: EnemyId = cast(EnemyId, None) PhotonTorpedo.nextId += 1
def __init__(self, filename: str, torpedoId: EnemyTorpedoId, speed: float = 3, scale: float = 1.0): GamePiece.__init__(self, filename=filename, speed=speed, scale=scale) SmoothMotion.__init__(self) self._baseEnemyTorpedoLogger: Logger = getLogger(__name__) self._id: EnemyTorpedoId = torpedoId self._firedBy: EnemyId = cast(EnemyId, None) self._firedFromPosition: Coordinates = cast(Coordinates, None) self._followers: SpriteList = cast(SpriteList, None) self._computer: Computer = Computer()