def __init__(self, x, y, firstShot, moveTable): super(MovableBattery1p, self).__init__() self.x = x self.y = y self.firstShot = firstShot self.moveTable = moveTable self.left = -11 self.top = -11 self.right = 11 self.bottom = 11 self.layer = gcommon.C_LAYER_GRD self.hitcolor1 = 13 self.hitcolor2 = 15 self.hp = 70 self.shotInterval = int(120 / GameSession.enemy_shot_rate) self.hitCheck = True self.shotHitCheck = True self.enemyShotCollision = False self.mover = CountMover(self, self.moveTable, False) self.ground = True self.score = 500 # 0 :閉じている # 1 :開く1 # 2 :開く2 # 3 :開く3 # 4 :開く4 ショット # 5 :開く3 # 6 :開く2 # 7 :開く1 self.shotState = 0 self.shotCnt = 0
def __init__(self, t): super(__class__, self).__init__() self.isBossRush = t[2] self.x = 256 + 32 self.y = 60 self.moveTable = __class__.moveTable0 self.mover = CountMover(self, self.moveTable, True) self.mover.deg = 180 self.stater = enemy.CountStater(self, __class__.stateTable0, True, True) self.stateTable = None self.left = -12 self.top = -12 self.right = 12 self.bottom = 12 self.hitcolor1 = 10 self.hitcolor2 = 7 self.layer = gcommon.C_LAYER_GRD self.exptype = gcommon.C_EXPTYPE_SKY_M self.ground = True self.hitCheck = True self.shotHitCheck = True self.hp = boss.BOSS_FIRE_HP self.score = 15000 self.cellCount = 13 self.cellDelay = 30 self.cellList = [] self.collisionRects = [] for i in range(self.cellCount * self.cellDelay): self.cellList.append([self.x, self.y, self.mover.deg]) pyxel.image(2).load(0, 0, "assets/bossFire.png") self.fireInterval = __class__.intervaTable[GameSession.difficulty] self.timerObj = None if self.isBossRush: self.timerObj = enemy.Timer1.create(80)
def __init__(self, t): super(Fighter4, self).__init__() self.x = t[2] self.y = t[3] self.moveTable = t[4] self.shotFirst = t[5] self.left = 4 self.top = 4 self.right = 13 self.bottom = 13 self.layer = gcommon.C_LAYER_SKY self.hp = 1 self.hitCheck = True self.shotHitCheck = True self.enemyShotCollision = False self.mover = CountMover(self, self.moveTable, False) self.score = 100
def __init__(self, t): super(__class__, self).__init__() pos = gcommon.mapPosToScreenPos(t[2], t[3]) self.x = pos[0] self.y = pos[1] self.moveTable = t[4] self.left = 8 self.top = 2 self.right = 15 self.bottom = 23-2 self.layer = gcommon.C_LAYER_GRD self.hp = 200 self.hitCheck = True self.shotHitCheck = True self.enemyShotCollision = False self.ground = True self.score = 200 self.mover = CountMover(self, self.moveTable, True)
def __init__(self, t): super(__class__, self).__init__() pos = gcommon.mapPosToScreenPos(t[2], t[3]) self.x = pos[0] + 7.5 self.y = pos[1] + 7.5 self.moveTable = t[4] self.left = -7 self.top = -7 self.right = 7 self.bottom = 7 self.layer = gcommon.C_LAYER_SKY self.hp = 200 self.ground = True self.hitCheck = True self.shotHitCheck = True self.enemyShotCollision = False self.score = 300 self.mover = CountMover(self, self.moveTable, False) self.startTimer = str(gcommon.game_timer)
def __init__(self, t): super(__class__, self).__init__() self.x = t[2] self.y = t[3] self.isBossRush = t[4] self.left = -45 self.top = -45 self.right = 45 self.bottom = 45 self.hp = boss.BOSS_LABYRINTH_1 self.layer = gcommon.C_LAYER_UNDER_GRD self.score = 5000 self.hitcolor1 = 3 self.hitcolor2 = 6 # 第n形態 self.state = 0 self.mover = CountMover(self, self.moveTable0, False) self.shiftPos = 0 self.timerObj = None if self.isBossRush: self.timerObj = enemy.Timer1.create(70)
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 __init__(self, t): super(ContainerCarrier1, 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.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.hitcolor1 = 13 self.hitcolor2 = 15 self.hitCheck = True self.shotHitCheck = True self.enemyShotCollision = False self.mover = CountMover(self, self.moveTable, False) self.ground = True self.score = 100
def __init__(self, mx, my, patternNo, startCount, moveNo): super(__class__, self).__init__() pos = gcommon.mapPosToScreenPos(mx, my) self.x = pos[0] self.y = pos[1] self.patternNo = patternNo self.moveNo = moveNo self.startCount = startCount self.left = 2 self.top = 2 self.tablePos = __class__.posTable[patternNo] self.tableSize = __class__.sizeTable[patternNo] self.right = self.tableSize[0] * 8 - 2 self.bottom = self.tableSize[1] * 8 - 2 self.layer = gcommon.C_LAYER_GRD self.hp = gcommon.HP_UNBREAKABLE self.ground = True self.hitCheck = True self.shotHitCheck = True self.enemyShotCollision = True self.shotEffect = False self.mover = CountMover(self, __class__.MoveTable[moveNo], False)
def __init__(self, t): super(__class__, self).__init__() self.x = t[2] self.y = t[3] self.moveTable = t[5] self.stateTable = t[6] self.layer = gcommon.C_LAYER_GRD self.ground = True self.hitCheck = True self.shotHitCheck = True self.hp = gcommon.HP_UNBREAKABLE self.mover = CountMover(self, self.moveTable, False) if self.stateTable != None: self.stater = enemy.CountStater(self, self.stateTable) else: self.stater = None self.mover.deg = t[4] self.cellCount = 12 self.cellDelay = 22 self.cellList = [] self.collisionRects = [] for i in range(self.cellCount * self.cellDelay): self.cellList.append([self.x, self.y, self.mover.deg])
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 broken(self): self.setState(100) self.shotHitCheck = False self.hitCheck = False self.mover = CountMover(self, self.moveTable100, False) enemy.removeEnemyShot()