def __init__(self): """ COMMON VARIABLES """ actor.Actor.__init__(self) self.actorType = ACTOR_TYPE_BAAKE self.animationList = copy.copy(self.MasterAnimationList) self.animationList.setParent(self) self.animationList.play("Idle") self.rect = self.image.get_rect() self.boundStyle = BOUND_STYLE_REFLECT self.bounds = [32,32,(SCREEN_WIDTH - 32),(SCREEN_HEIGHT - 32)] self.canCollide = True self.hitrect = pygame.Rect(0,0,108,88) self.position = vector.vector2d(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2) self.velocity = vector.vector2d(5.0,0.0) """ UNIQUE VARIABLES """ self.speed = 5.0 self.changeDirection = 0 """ BOSS FIGHT """ self.leaveScreen = False aitools.spawnOnScreen(self)
def update(self): if self.DoOnce: CloudsToCreate = 11 while CloudsToCreate: tempCloud = scenery.CloudSmall() aitools.spawnOnScreen(tempCloud) self.actorGroup2.add(tempCloud) CloudsToCreate -= 1 IslandsToCreate = 3 while IslandsToCreate: tempIsland = scenery.IslandBig() aitools.spawnOnScreen(tempIsland) self.actorGroup2.add(tempIsland) IslandsToCreate -= 1 CloudsToCreate = 7 while CloudsToCreate: tempCloud = scenery.Cloud() aitools.spawnOnScreen(tempCloud) self.actorGroup1.add(tempCloud) CloudsToCreate -= 1 self.DoOnce = False IslandsToCreate = 9 while IslandsToCreate: tempIsland = scenery.IslandSmall() aitools.spawnOnScreen(tempIsland) self.actorGroup3.add(tempIsland) IslandsToCreate -= 1 self.actorGroup3.update() self.actorGroup2.update() self.actorGroup1.update()
def update(self): if self.DoOnce: CloudsToCreate = 3 while CloudsToCreate: tempIsland = scenery.whiteCloud() aitools.spawnOnScreen(tempIsland) self.actorGroup1.add(tempIsland) CloudsToCreate -= 1 TreesToCreate = 3 while TreesToCreate: tempTree = scenery.treeBig() aitools.spawnOnScreen(tempTree) self.actorGroup1.add(tempTree) TreesToCreate -= 1 CloudsToCreate = 4 while CloudsToCreate: tempIsland = scenery.whiteCloudSmall() aitools.spawnOnScreen(tempIsland) self.actorGroup2.add(tempIsland) CloudsToCreate -= 1 TreesToCreate = 4 while TreesToCreate: tempTree = scenery.treeSmall() aitools.spawnOnScreen(tempTree) self.actorGroup2.add(tempTree) TreesToCreate -= 1 CloudsToCreate = 6 while CloudsToCreate: tempIsland = scenery.whiteCloudTiny() aitools.spawnOnScreen(tempIsland) self.actorGroup3.add(tempIsland) CloudsToCreate -= 1 self.DoOnce = False self.actorGroup3.update() self.actorGroup2.update() self.actorGroup1.update()
def update(self): if self.DoOnce: CloudsToCreate = 6 while CloudsToCreate: tempCloud = scenery.blueCloud() aitools.spawnOnScreen(tempCloud) self.actorGroup1.add(tempCloud) CloudsToCreate -= 1 CloudsToCreate = 6 while CloudsToCreate: tempCloud = scenery.blueCloudSmall() aitools.spawnOnScreen(tempCloud) self.actorGroup2.add(tempCloud) CloudsToCreate -= 1 StarsToCreate = 12 while StarsToCreate: tempStar = scenery.smallStar() aitools.spawnOnScreen(tempStar) self.actorGroup3.add(tempStar) StarsToCreate -= 1 self.DoOnce = False self.actorGroup1.update() self.actorGroup2.update() self.actorGroup3.update()