def update(self): if self.cnt % self.interval == 0: ObjMgr.addObj(FireBird1([0, 0, self.x, self.y])) self.cnt2 += 1 self.y += self.offset if self.cnt2 >= self.max: self.remove()
def doExplosion(self): index = 0 for i in range(self.cellCount): ObjMgr.addObj( BossFireExplosion(self.cellList[index][0], self.cellList[index][1], False)) index += self.cellDelay
def updateMode2(self): if self.state == 0: if self.cnt > 120: self.nextState() elif self.state == 1: # 右の画面外に移動 if self.cnt == 1: obj = enemy.Splash.appendDr(self.coreX, self.coreY -8, gcommon.C_LAYER_SKY, math.pi, math.pi/6, 20) obj.ground = True obj = enemy.Splash.appendDr(self.coreX -16, self.coreY, gcommon.C_LAYER_SKY, math.pi, math.pi/6, 20) obj.ground = True obj = enemy.Splash.appendDr(self.coreX, self.coreY +8, gcommon.C_LAYER_SKY, math.pi, math.pi/6, 20) obj.ground = True if self.coreX < 300: self.coreX += 4 if self.cnt == 120: gcommon.scroll_flag = True # ボスコアを生成 ObjMgr.addObj(BossLast1Core(self.coreX, self.coreY, self.isBossRush)) if self.isBossRush == False: ObjMgr.addObj(enemy.Delay(BossLastBaseExplosion, [], 240)) BGM.play(BGM.BOSS_LAST) if self.x <= -160: self.remove() self.rad = (self.rad + math.pi/30) % (math.pi * 2)
def fire(self, x, y, deg, speed): obj = enemyOthers.Fire2(x, y, deg) obj.imageSourceIndex = 2 obj.imageSourceX = 64 obj.imageSourceY = 64 obj.speed = speed ObjMgr.addObj(obj)
def update(self): if gcommon.game_timer >= self.removeTime: self.remove() return if self.cnt % 120 == 0: pos = gcommon.mapPosToScreenPos(self.mx, self.my) ObjMgr.addObj(Lift2(pos[0], pos[1], self.dy))
def __init__(self, t): super(Boss1, self).__init__() self.x = t[2] self.y = t[3] self.isBossRush = t[4] self.left = 16 self.top = 16 self.right = 93 self.bottom = 45 self.collisionRects = gcommon.Rect.createFromList([[1, 23, 15, 37], [16, 16, 93, 45]]) self.hp = gcommon.HP_NODAMAGE self.layer = gcommon.C_LAYER_UNDER_GRD self.score = 5000 self.subcnt = 0 self.hitcolor1 = 9 self.hitcolor2 = 10 self.brake = False self.beam = 0 self.subState = 0 self.isLeft = True self.beamTime = __class__.beamTimes[GameSession.difficulty] #gcommon.debugPrint("beam Time = " + str(self.beamTime)) self.tbl = [] self.shotFlag = False self.dy = 0.0 self.beamObj = Boss1Beam(self) ObjMgr.addObj(self.beamObj) self.timerObj = None if self.isBossRush: self.y = 36 self.state = 900
def update(self): self.x += self.speed if self.x > gcommon.SCREEN_MAX_X: self.remove() return if self.cnt % 3 == 0: obj = enemyOthers.Smoke1(self.x - 8, self.y + 3) obj.ground = True ObjMgr.addObj(obj) if self.speed < 6.0: self.speed += 0.1
def update(self): if self.state == 0: self.y += self.flag if self.cnt > 20: self.nextState() else: self.x -= 2 if self.x <= -16: self.remove() return if self.cnt % 30 == (15 + self.flag * 5): ObjMgr.addObj(BossLastBattery1Beam(self.x, self.y, 2 * self.flag))
def update(self): while True: t = __class__.table[self.tableIndex] if t[0] == (self.cnt - self.prevCnt): ObjMgr.addObj(Prominence1(self.x, self.y, t[2], t[1])) self.tableIndex += 1 if self.tableIndex >= len(__class__.table): self.remove() return self.prevCnt = self.cnt else: return
def __init__(self, t): super(MovableBattery1, self).__init__() self.mx = t[2] self.my = t[3] pos = gcommon.mapPosToScreenPos(t[2], t[3]) self.x = pos[0] + 3.5 self.y = pos[1] + 3.5 self.firstShot = t[4] self.moveTable = t[5] if self.x <= -96 or self.x >= gcommon.SCREEN_MAX_X+96 or self.y <= -96 or self.y >= gcommon.SCREEN_MAX_Y+96: gcommon.debugPrint("MovableBattery1 is ng start point (" + str(self.mx) + ","+ str(self.my) +") (" + str(self.x) + "," + str(self.y)+"") else: ObjMgr.addObj(MovableBattery1p(self.x, self.y, self.firstShot, self.moveTable)) self.remove()
def ExecuteStory(self): while True: if len(self.story) <= self.story_pos: return s = self.story[self.story_pos] if s[0] < gcommon.game_timer: pass elif s[0] != gcommon.game_timer: return else: t = s[1] # [1]はクラス型 obj = t(s) # ここでインスタンス化 ObjMgr.addObj(obj) self.story_pos = self.story_pos + 1
def __init__(self, t): super(Boss2, self).__init__() self.t = gcommon.T_BOSS1 self.isBossRush = t[4] if self.isBossRush: self.x = t[2] self.y = t[3] else: pos = gcommon.mapPosToScreenPos(t[2], t[3]) self.x = pos[0] self.y = pos[1] self.left = 16 self.top = 9 self.right = 63 self.bottom = 38 self.hp = 999999 # 破壊できない self.layer = gcommon.C_LAYER_GRD self.ground = True self.score = 7000 self.subcnt = 0 self.dx = 0.5 self.dy = 0 self.hitcolor1 = 3 self.hitcolor2 = 7 self.tblIndex = 0 self.cycleCount = 0 self.brake = False self.feelers = [] self.feelers.append(Feeler(self, 50, 29, 8, 6)) self.feelers.append(Feeler(self, 16, 29, 24, 6)) self.feelers.append(Feeler(self, 16, 8, 40, 6)) self.feelers.append(Feeler(self, 50, 8, 56, 6)) self.feelerShots = [] ObjMgr.addObj(self.feelers[0]) ObjMgr.addObj(self.feelers[1]) ObjMgr.addObj(self.feelers[2]) ObjMgr.addObj(self.feelers[3]) self.bossCells = [] self.timerObj = None if self.isBossRush: self.layer = gcommon.C_LAYER_SKY self.ground = False self.state = 900 self.x = 256 self.y = 81 else: self.bossBase = Boss2Base2(self) ObjMgr.addObj(self.bossBase)
def update(self): if self.cnt % 3 == 0: obj = ObjMgr.addObj(enemy.Explosion(32 +random.randrange(64), random.randrange(gcommon.SCREEN_MAX_Y), gcommon.C_LAYER_GRD, gcommon.C_EXPTYPE_SKY_M)) obj.particle = False if self.cnt < 120: # 120超えるとサウンドなし BGM.sound(gcommon.SOUND_MID_EXP)
def broken(self): self.setState(100) self.shotHitCheck = False enemy.removeEnemyShot() ObjMgr.objs.append(boss.BossExplosion(gcommon.getCenterX(self), gcommon.getCenterY(self), gcommon.C_LAYER_EXP_SKY)) GameSession.addScore(self.score) self.remove() BGM.sound(gcommon.SOUND_LARGE_EXP) enemy.Splash.append(gcommon.getCenterX(self), gcommon.getCenterY(self), gcommon.C_LAYER_EXP_SKY) if self.isBossRush: if self.timerObj != None: self.timerObj.stop() self.timerObj = None ObjMgr.objs.append(enemy.NextEvent([0, None, 120])) else: ObjMgr.addObj(enemy.Delay(enemy.StageClear, None, 240))
def update(self): if self.x < -40 or self.x > gcommon.SCREEN_MAX_X + 16: self.remove() return if self.state == 0 and self.first == self.cnt: self.nextState() elif self.state == 1: if self.cnt > 180: self.nextState() return elif self.cnt % 30 == 0: ObjMgr.addObj( Cell3([ 0, 0, self.x + 12, self.y, 0.0, -1.0 + self.mirror * 2.0, 60 ]))
def shotHomingMissile(self): if self.homingMissileFlag: if self.homingMissileCnt == 20: obj = enemy.HomingMissile1(self.x + 68, self.y + 8, 48) obj.imageSourceIndex = 1 obj.imageSourceX = 128 obj.imageSourceY = 80 ObjMgr.addObj(obj) obj = enemy.HomingMissile1(self.x + 68, self.y + 48, 16) obj.imageSourceIndex = 1 obj.imageSourceX = 128 obj.imageSourceY = 80 ObjMgr.addObj(obj) self.homingMissileCnt += 1 if self.homingMissileCnt >= self.homingMissileInterval: self.homingMissileCnt = 0
def addProminence(self): s = 1.0 for i in range(self.pCount): #ObjMgr.addObj(Prominence1(self.x, self.y, self.radius + (i -self.pCount/2)*3 , 1)) if i > (self.pCount >> 1): ObjMgr.addObj( Prominence2( self.x, self.y, self.radius + s * self.pCount * (self.pCount - i) / self.pCount, 1, self.direction, self.position)) else: ObjMgr.addObj( Prominence2( self.x, self.y, self.radius + s * self.pCount * (self.pCount - i) / self.pCount, 0, self.direction, self.position)) s = -1.0 if s == 1.0 else 1
def __init__(self, t): super(BossLast1, self).__init__() self.isBossRush = t[2] self.x = 256 self.y = 0 self.left = 52 self.top = 80 self.right = 111 self.bottom = 111 self.hp = BossLast1.initHp self.layer = gcommon.C_LAYER_UNDER_GRD self.ground = True self.score = 20000 self.exptype = gcommon.C_EXPTYPE_GRD_BOSS # 破壊状態 self.brokenState = 0 self.coreBrightState = 0 self.coreBrightness = 0 self.shotType = 3 self.beamIndex = 0 self.cycleCount = 0 # 本体ビームカウント self.cycleCount2 = 0 self.beam1List = [None] * 4 self.beam2 = None self.roundBeam = None # ボスの攻撃形態 self.mode = 0 self.coreX = self.x +32+16+32 self.coreY = self.y +64+16+16 # コアの回転角度 self.rad = 0.0 self.subState = 0 self.subCnt = 0 self.arrowRad = math.pi self.omega = 0.0 self.random = gcommon.ClassicRand() self.fallShot2RadIndex = 0 pyxel.image(2).load(0,0,"assets/graslay_last-3.png") # 移動ビーム砲台発射口 ObjMgr.addObj(BossLast1Launcher(self.x, self.y, -1)) ObjMgr.addObj(BossLast1Launcher(self.x, self.y +176, 1)) self.timerObj = None if self.isBossRush: self.timerObj = enemy.Timer1.create(100)
def update(self): if self.cnt == 0: self.initY = __class__.initYTable[self.moveTableNo] + gcommon.map_y #gcommon.debugPrint("init y = " + str(self.initY)) if self.cnt % self.interval == 0: shotFirst = self.shotFirst if GameSession.difficulty == gcommon.DIFFICULTY_EASY: shotFirst = -1 elif GameSession.difficulty == gcommon.DIFFICULTY_NORMAL: if self.cnt2 != self.max - 1: shotFirst = -1 x = 256 if self.moveTableNo == 4: x = -16 ObjMgr.addObj( Fighter4([ 0, 0, x, self.initY - gcommon.map_y, __class__.moveTableTable[self.moveTableNo], shotFirst ])) self.cnt2 += 1 if self.cnt2 >= self.max: self.remove()
def __init__(self, t): super(Tractor1, self).__init__() pos = gcommon.mapPosToScreenPos(t[2], t[3]) self.x = pos[0] + 3.5 self.y = pos[1] + 3.5 self.moveTable = t[4] self.left = -11 self.top = -11 self.right = 11 self.bottom = 11 self.layer = gcommon.C_LAYER_GRD self.hp = 50 self.hitCheck = True self.shotHitCheck = True self.enemyShotCollision = False self.mover = CountMover(self, self.moveTable, False) self.ground = True self.score = 100 # 貨物車を追加 obj = Freight1(self, 0, 36, 1) ObjMgr.addObj(obj) ObjMgr.addObj(Freight1(obj, 0, 48, 2))
def attack0(self): if self.attackCnt % 180 == 0: # レーザー omega = math.pi / 4 if self.cnt % 360 == 0 else -math.pi / 4 if GameSession.isHard(): for i, pt in enumerate(__class__.laserPointTable): ObjMgr.addObj( boss.ChangeDirectionLaser1( self.x + pt[0], self.y + pt[1], -math.pi / 2 - math.pi / 16 + math.pi / 4 * i, omega)) else: for i, pt in enumerate(__class__.laserPointTable): if i & 1 == 0: ObjMgr.addObj( boss.ChangeDirectionLaser1( self.x + pt[0], self.y + pt[1], -math.pi / 2 - math.pi / 16 + math.pi / 4 * i, omega)) self.attackCnt += 1 if self.attackCnt >= 180: self.attackCnt = 0 self.attackState += 1
def update(self): if self.state == 0: # 上に射出 if self.dy < 4.0: self.dy += 0.060 elif self.dy > 0: # ボスから射出されるときはレイヤが後ろなので self.layer = gcommon.C_LAYER_SKY self.x += self.dx self.y += self.dy if self.y + gcommon.map_y + 8 > gcommon.waterSurface_y: enemy.WaterSplash.appendDr( self.x + 8, gcommon.waterSurface_y - gcommon.map_y, gcommon.C_LAYER_SKY, math.pi * 1.5, math.pi / 6, 30) self.nextState() elif self.state == 1: self.dx *= 0.5 self.dy -= 0.5 self.x += self.dx self.y += self.dy if self.dy < -2.0: self.nextState() elif self.state == 2: self.dx *= 0.8 self.dy *= 0.8 self.x += self.dx self.y += self.dy if abs(self.dy) < 0.1: self.nextState() elif self.state == 3: if self.cnt >= 60: self.remove() enemy.Particle2.append(self.x + 8, self.y + 8, 20) rad = math.pi * 1.25 if self.x < 112 else math.pi * 1.75 obj = Bat1a(self.parent, self.x, self.y, rad) self.parent.appendBat(obj) ObjMgr.addObj(obj)
def update(self): self.countMover.update() self.gun_cx = self.x + 20.0 self.gun_cy = self.y self.subCnt += 1 if abs(self.countMover.dx) > 0.025 or abs(self.countMover.dy) > 0.025: self.wheelCnt += 1 if self.state == 0: if self.countMover.tableIndex in (2, 4, 6, 8, 10): self.gunRad = gcommon.getRadToShip(self.x, self.y, self.gunRad +math.pi, math.pi/60) - math.pi elif self.countMover.tableIndex in (1, 3, 5, 7, 9, 11): self.shotMainState() if self.countMover.tableIndex == 1: if self.countMover.cnt % 45 == 0: ObjMgr.addObj(enemyBattery.MovableBattery1p(self.x -16, self.y, 30, [[100*8, 0, -1.0, 0.0]])) elif self.countMover.tableIndex == 5: if self.countMover.cnt % 45 == 0: ObjMgr.addObj(enemyBattery.MovableBattery1p(self.x -16, self.y, 30, [[0, 5, 44, self.y, 1.0],[100*8, 0, 0.0, 1.0]])) elif self.countMover.tableIndex == 9: if self.countMover.cnt % 45 == 0: ObjMgr.addObj(enemyBattery.MovableBattery1p(self.x -16, self.y, 30, [[0, 5, 44, self.y, 1.0],[100*8, 0, 0.0, -1.0]])) if self.hp < boss.BOSS_WAREHOUSE_HP/3: # 発狂モード self.state = 1 elif self.state == 1: # 発狂モード if self.gunRad < 0.75 * math.pi: self.gunRad += 0.025* math.pi else: self.nextState() elif self.state == 2: if self.cnt % self.crazyShotInterval == 0: self.shotMain() self.gunRad -= 0.025* math.pi if self.gunRad < -0.75 * math.pi: self.nextState() elif self.state == 3: if self.cnt % self.crazyShotInterval == 0: self.shotMain() self.gunRad += 0.025* math.pi if self.gunRad > 0.75 * math.pi: self.setState(1)
def attack1(self): if GameSession.isEasy(): return if self.attackCnt % 10 == 0: n = int(self.attackCnt / 10) pt = __class__.laserPointTable[n] if GameSession.isHard(): ObjMgr.addObj( boss.DelayedShotLaser1( self.x + pt[0], self.y + pt[1], -math.pi / 2 + math.pi / 4 * n + math.pi / 16)) ObjMgr.addObj( boss.DelayedShotLaser1( self.x + pt[0], self.y + pt[1], -math.pi / 2 + math.pi / 4 * n - math.pi / 16)) else: ObjMgr.addObj( boss.DelayedShotLaser1(self.x + pt[0], self.y + pt[1], -math.pi / 2 + math.pi / 4 * n)) self.attackCnt += 1 if self.attackCnt > 10 * 7: self.attackCnt = 0 self.attackState += 1
def doEffect(self, effectSound): # 跳弾表示 ObjMgr.addObj(enemy.Particle1(self.x + self.right, self.y, 0.0, 4, 50)) if effectSound: BGM.sound(gcommon.SOUND_HIT, gcommon.SOUND_CH2)
def createByPos(cls, x, y, hide=False): return ObjMgr.addObj(ScoreItem1(x, y, hide))
def shotBoss2Feeler(self, x, y, rad): self.feelerShots.append(ObjMgr.addObj(Boss2FeelerShot(self, x, y, rad)))
def update(self): self.mover.update() if self.state == 1: if self.mover.tableIndex == 0: # STOP self.shiftPos = (self.mover.cnt/30) * 8 elif self.mover.tableIndex == 11: # STOP self.shiftPos = 8 -(self.mover.cnt/30) * 8 elif self.mover.tableIndex >= 1: if self.mover.mode == CountMover.MOVE: fx = 1 dr = 32 if self.x < ObjMgr.myShip.x: fx = -1 dr = 0 if self.cnt % 60 == 0: if GameSession.isEasy(): enemy.enemy_shot_dr_multi(self.x -48 * fx, self.y-20, 3, 0, dr, 3, 4) enemy.enemy_shot_dr_multi(self.x -48 * fx, self.y+20, 3, 0, dr, 3, 4) elif GameSession.isHard(): enemy.enemy_shot_dr_multi(self.x -48 * fx, self.y-20, 3, 0, dr, 6, 2) enemy.enemy_shot_dr_multi(self.x -48 * fx, self.y+20, 3, 0, dr, 6, 2) else: enemy.enemy_shot_dr_multi(self.x -48 * fx, self.y-20, 3, 0, dr, 4, 3) enemy.enemy_shot_dr_multi(self.x -48 * fx, self.y+20, 3, 0, dr, 4, 3) elif self.state == 2: if self.mover.tableIndex == 0: # STOP self.shiftPos = (self.mover.cnt/30) * 8 elif self.mover.tableIndex == 11: # STOP self.shiftPos = 8 -(self.mover.cnt/30) * 8 elif self.mover.tableIndex >= 1: if self.mover.mode == CountMover.MOVE: fx = 1 if self.x < ObjMgr.myShip.x: fx = -1 speed = -4.0 if self.x < ObjMgr.myShip.x: speed = 4.0 if self.cnt % 60 == 0: #enemy.enemy_shot_dr_multi(self.x -48 * fx, self.y-20, 3, 0, dr, 4, 3) #enemy.enemy_shot_dr_multi(self.x -48 * fx, self.y+20, 3, 0, dr, 4, 3) ObjMgr.addObj(BossLabyrinthShot1(self.x -48 * fx, self.y, speed)) # ObjMgr.addObj(BossLabyrinthShot1(self.x -48, self.y-20, 4)) # ObjMgr.addObj(BossLabyrinthShot1(self.x -48, self.y+20, 4)) # ObjMgr.addObj(BossLabyrinthShot1(self.x -48, self.y+20+16, 4)) if self.mover.cnt == 30: ObjMgr.addObj(BossLabyrinthBeam1(self, 32, -32, math.pi * 1.75)) ObjMgr.addObj(BossLabyrinthBeam1(self, -32, -32, math.pi * 1.25)) ObjMgr.addObj(BossLabyrinthBeam1(self, -32, 32, math.pi * 0.75)) ObjMgr.addObj(BossLabyrinthBeam1(self, 32, 32, math.pi * 0.25)) elif self.state == 100: # 破壊状態 if self.cnt % 10 == 0: enemy.create_explosion2(self.x + random.randrange(-30, 30), self.y + random.randrange(-30, 30), self.layer, gcommon.C_EXPTYPE_SKY_M, -1) if self.cnt > 120: self.mover = CountMover(self, self.moveTable101, False) self.nextState() elif self.state == 101: # 破壊状態 if self.cnt > 90: self.remove() ObjMgr.addObj(BossLabyrinth2(self.isBossRush, self.timerObj)) if self.state < 100 and self.mover.isEnd: if self.state == 0: self.setState(1) self.mover = CountMover(self, self.moveTable1, False) elif self.state == 1: self.setState(2) self.mover = CountMover(self, self.moveTable1, False) elif self.state == 2: self.setState(1) self.mover = CountMover(self, self.moveTable1, False)
def update(self): if self.state == 0: # 出現 if self.cnt >= 79: self.nextState() elif self.state == 1: # 光る if self.cnt >= 60: self.nextState() elif self.state == 2: # スプレッドレーザー攻撃(攻撃前の伸び) self.arm1Pos += 1 if self.arm1Pos >= 48: self.nextState() elif self.state == 3: # 待ち if self.cnt > 30: self.nextState() elif self.state == 4: # スプレッドレーザー発射 if self.cnt % 30 == 0: n = int(self.cnt /30) if self.speadBeamFlag: pos = 3 - n else: pos = n if pos <= 2: y = self.y-39.5 +16 -48 + pos * 16 +3 ObjMgr.addObj(BossLabyrinthShot1(self.x -22, y, -4, spreadTime=30)) y = self.y+23.5 -16 +48 - pos * 16 +11 ObjMgr.addObj(BossLabyrinthShot1(self.x -22, y, -4, spreadTime=30)) else: ObjMgr.addObj(BossLabyrinthShot1(self.x -58, self.y -13, -4, spreadTime=30)) ObjMgr.addObj(BossLabyrinthShot1(self.x -58, self.y +13, -4, spreadTime=30)) if n >= 3: self.speadBeamFlag = not self.speadBeamFlag self.nextState() elif self.state == 5: self.arm1Pos -= 1 self.arm2Pos += 1 if self.arm2Pos >= 48: #gcommon.debugPrint("arm1 " + str(self.arm1Pos) + " arm2 " + str(self.arm2Pos)) self.nextState() elif self.state == 6: # ダイアモンドビーム if self.cnt % 30 == 0: ObjMgr.addObj(BossLabyrinthBeam2(self.x +27, self.y-32, -math.pi/2)) ObjMgr.addObj(BossLabyrinthBeam2(self.x +27, self.y+32, +math.pi/2)) # dr64 = 16 + 4 + int(self.cnt/10) # enemy.enemy_shot_dr(self.x +16.5, self.y-39.5 -self.arm2Pos +8, 3, 0, dr64) # dr64 = 48 -4 -18 + int(self.cnt/10) # enemy.enemy_shot_dr(self.x +16.5, self.y+23.5 +self.arm2Pos +8, 3, 0, dr64) if self.cnt >= 180: self.nextState() elif self.state == 7: # ARM2収納 self.arm2Pos -= 1 if self.arm2Pos == 0: self.nextState() elif self.state == 8: # 艦首ビーム砲準備 if self.cnt == 0: # ビーム発射前の吸い込むようなやつ self.beamPrepareEffect = ObjMgr.addObj(boss.BeamPrepareEffect1(self, -7*8, 0.0)) elif self.cnt > 120: if self.beamPrepareEffect != None: self.beamPrepareEffect.remove() self.beamPrepareEffect = None self.nextState() else: # 自機を追いかける self.chaseToMyShip() elif self.state == 9: if self.cnt == 0: self.dx = 4.0 self.x += self.dx if self.dx > -1.0: self.dx -= 0.1 if self.x <= 200: self.dx = 0.0 self.x = 200 # ぴったりじゃないと気が済まない self.nextState() # 艦首ビーム発射 if self.cnt == 0: ObjMgr.addObj(BossLabyrinthBeam1(self, -7*8, 0.0, math.pi, beamTime=180)) self.dx = 4.0 elif self.state == 10: # ビーム発射しつつ、移動 self.chaseToMyShip() if self.cnt > 60: self.nextState() elif self.state == 11: # Y座標調整 if self.y > 96: self.y -= 1.0 elif self.y < 96: self.y += 1.0 if math.fabs(self.y -96) < 1.0: self.y = 96.0 self.setState(2) self.collisionRects = [] self.collisionRects.append(__class__.bodyRect1) self.collisionRects.append(__class__.bodyRect2) self.collisionRects.append(gcommon.Rect.createWH(-31.5 +14, -39.5 +6 -self.arm1Pos, 30, 8)) self.collisionRects.append(gcommon.Rect.createWH(-31.5 +14, 24.5 +2 +self.arm1Pos, 30, 8)) self.collisionRects.append(gcommon.Rect.createWH(+16.5+4, -39.5 +4 -self.arm2Pos/3, 25, 12)) self.collisionRects.append(gcommon.Rect.createWH(+16.5+4, 24.5 +self.arm2Pos/3, 25, 12)) if self.arm1Pos > 0: self.collisionRects.append(gcommon.Rect.createWH(-31.5 +28, -39.5 +16 -self.arm1Pos, 11, self.arm1Pos)) self.collisionRects.append(gcommon.Rect.createWH(-31.5 +28, 24.5, 11, self.arm1Pos))
def fire2(self, x, y, deg, speed): obj = enemyOthers.Fire3(x, y, deg) ObjMgr.addObj(obj)