def broken(self): enemy.create_explosion(gcommon.getCenterX(self), gcommon.getCenterY(self), gcommon.C_LAYER_EXP_SKY, gcommon.C_EXPTYPE_SKY_L) #gcommon.ObjMgr.objs.append(Boss3Explosion(gcommon.getCenterX(self), gcommon.getCenterY(self), gcommon.C_LAYER_EXP_GRD)) gcommon.ObjMgr.objs.append(Boss3B(gcommon.getCenterX(self), self.y + 50)) enemy.Splash.append(gcommon.getCenterX(self), gcommon.getCenterY(self), gcommon.C_LAYER_EXP_SKY) self.remove() self.outside.setState(100) gcommon.score+=10000
def broken(self): self.brokenflag = 1 self.layer = gcommon.C_LAYER_HIDE_GRD enemy.create_explosion( self.x+(self.right-self.left+1)/2, self.y+30*2, gcommon.C_LAYER_SKY, gcommon.C_EXPTYPE_SKY_M) gcommon.score += self.score
def broken(self): if self.state<100: self.layer = gcommon.C_LAYER_EXP_SKY self.cnt = 0 self.state= 102 enemy.create_explosion( self.x+(self.right-self.left+1)/2, self.y+(self.bottom-self.top+1)/2-4, self.layer, gcommon.C_EXPTYPE_GRD_M) gcommon.score+=10000
def doShotCollision(self, shot): ret = super(BossLast1, self).doShotCollision(shot) if self.mode == 0: if self.brokenState == 0 and self.hp < BossLast1.hp2: # 初期状態⇒先端が欠けた状態 self.brokenState = 1 enemy.create_explosion(self.x +32+32, self.y +64+16+16, gcommon.C_LAYER_GRD, gcommon.C_EXPTYPE_GRD_M) GameSession.addScore(1000) elif self.brokenState == 1 and self.hp < BossLast1.hp3: # 先端が欠けた状態⇒コアむき出し状態 self.brokenState = 2 self.mode = 1 self.setState(0) self.removeAllShot() enemy.create_explosion(self.x +32+32, self.y +64+16+16, gcommon.C_LAYER_GRD, gcommon.C_EXPTYPE_GRD_M) enemy.Splash.append(self.x +32+32+24, self.y +64+16+16, gcommon.C_LAYER_EXP_SKY) GameSession.addScore(3000) return ret
def update(self): if self.state == 0: if self.cnt == 600: gcommon.ObjMgr.objs.append(Boss3Body(self)) self.nextState() if self.state in (0,1): self.x += self.dx self.y += self.dy mode = boss3tbl[self.tblIndex][2] if mode == 1: if self.x < boss3tbl[self.tblIndex][3]: self.dx *= 0.95 self.dy *= 0.95 if abs(self.dx) < 0.01: self.nextTbl() else: self.addDxDy() elif mode == 2: if self.x > boss3tbl[self.tblIndex][3]: self.dx *= 0.95 self.dy *= 0.95 if abs(self.dx) < 0.01: self.nextTbl() else: self.addDxDy() elif mode == 3: # 上制限(上移動) if self.y < boss3tbl[self.tblIndex][3]: self.dx *= 0.95 self.dy *= 0.95 if abs(self.dy) <=0.01: self.nextTbl() else: self.addDxDy() elif mode == 4: # 下制限(下移動) if self.y > boss3tbl[self.tblIndex][3]: self.dx *= 0.95 self.dy *= 0.95 if abs(self.dy) <= 0.01: self.nextTbl() else: self.addDxDy() elif self.state == 100: # broken self.dx = 0 self.dy = 0 if self.cnt == 80: self.nextState() elif self.state == 101: self.y += gcommon.cur_scroll if self.cnt == 40: self.nextState() elif self.state == 102: self.y += gcommon.cur_scroll if self.cnt % 10 == 0: enemy.create_explosion( self.x+(self.right-self.left)/2 +random.randrange(80)-40, self.y+(self.bottom-self.top)/2 +random.randrange(80)-30, self.layer,gcommon.C_EXPTYPE_GRD_M) if self.cnt == 120: gcommon.ObjMgr.objs.append(Boss3Explosion(gcommon.getCenterX(self), gcommon.getCenterY(self), gcommon.C_LAYER_EXP_GRD)) self.nextState() elif self.state == 103: self.y += gcommon.cur_scroll if self.cnt == 120: self.remove()
def update(self): if gcommon.game_timer==3720: gcommon.cur_scroll=0 if gcommon.is_outof_bound(self): self.removeFlag = True else: if self.state==0: if self.cnt>240: self.cnt=0 self.state=1 elif self.state==1: if gcommon.cur_scroll==0: self.y -= 0.5 * 2 elif self.cnt & 64==0: self.y -= 0.35 * 2 self.boss1_shot_cross() if self.y<=0: self.state=2 self.cnt=0 elif self.state==2: remove_all_battery() if self.subcnt==0: self.hp=1000 if self.cnt & 7==7 and self.cnt & 127 !=127: enemy.enemy_shot( \ self.x+18*2 +math.cos(gcommon.atan_table[self.cnt & 63])*8, \ self.y+10*2 +math.sin(gcommon.atan_table[self.cnt & 63])*8, \ 2*2,1) gcommon.sound(gcommon.SOUND_SHOT2) self.sd = (self.cnt & 4)>>2 if self.cnt==300: self.state=3 self.cnt=0 elif self.state==3: if self.cnt & 15 ==15: shot_cross(self.x+18*2, self.y+12*2, self.cnt>>2) gcommon.sound(gcommon.SOUND_SHOT2) self.sd = (self.cnt & 4)>>2 if self.cnt==300: self.state=4 self.subcnt = 0 self.cnt=0 elif self.state==4: if self.cnt & 31== 31: if self.cnt & 63==63: for i in range(1,6): enemy.enemy_shot_offset(self.x+18*2, self.y+10*2, 2*2,1,(i-3)*2) else: for i in range(1,7): enemy.enemy_shot_offset(self.x+18*2, self.y+10*2, 2*2,1,(i-4)*2+1) gcommon.sound(gcommon.SOUND_SHOT2) if self.cnt==120: create_battery1(12*2,16*2,1) create_battery1(28*2,16*2,240) create_battery1(92*2,16*2,240) create_battery1(108*2,16*2,1) if self.cnt==300: self.state=5 self.cnt=0 ## self.subcnt+=1 # if self.subcnt==1: # self.state=5 # create_battery1(12*2,16*2,1) # create_battery1(28*2,16*2,240) # create_battery1(92*2,16*2,240) # create_battery1(108*2,16*2,1) # self.cnt=0 # self.subcnt=0 # else: # self.subcnt = 0 # self.state=2 # self.cnt=0 # elif self.state==5: self.y += 0.25*2 self.boss1_shot_cross() if self.y>=50: self.state=6 self.cnt=0 elif self.state==6: self.boss1_shot_cross() if self.cnt==300: self.state=7 self.cnt=0 elif self.state==7: self.y -= 0.25*2 self.boss1_shot_cross() if self.y<=8: self.state=2 self.cnt=0 self.subcnt+=1 elif self.state==100: if self.cnt>120: self.state=101 self.cnt=0 elif self.state==101: if self.cnt % 12 == 0: enemy.create_explosion( self.x+(self.right-self.left)/2 +random.randrange(36)-18, self.y+(self.bottom-self.top)/2 +random.randrange(24)-12, self.layer,gcommon.C_EXPTYPE_GRD_M) if self.cnt>240: self.state=102 self.cnt=0 #pyxel.play(1, 5) gcommon.sound(gcommon.SOUND_LARGE_EXP) elif self.state==102: #sfx(4) if self.cnt>150: self.state=103 self.cnt=0 elif self.state==103: if self.cnt>180: self.state=104 self.cnt=0 gcommon.cur_scroll=0.4 gcommon.ObjMgr.objs.append(enemy.StageClearText(1))
def update(self): if self.flag: if self.state == 0: self.size += 0.05 if self.size >= 0.125: self.size = 0.125 if self.cnt > 45: self.hitCheck = True self.nextState() elif self.state == 1: self.size += 0.05 if self.size >= 2.0: self.size = 2.0 if self.cnt > 45: self.nextState() elif self.state == 2: if self.cnt > 30: self.nextState() elif self.state == 3: self.rad -= self.omega if self.rad < (math.pi -self.angle): self.nextState() elif self.state == 4: self.rad += self.omega if self.rad > (math.pi +self.angle): self.nextState() elif self.state == 5: self.rad -= self.omega if self.rad <= math.pi: self.rad = math.pi self.nextState() else: self.size -= 0.05 if self.size <= 0: self.remove() else: if self.state == 0: self.size += 0.05 if self.size >= 0.125: self.size = 0.125 if self.cnt > 45: self.hitCheck = True self.nextState() elif self.state == 1: self.size += 0.05 if self.size >= 2.0: self.size = 2.0 if self.cnt > 45: self.nextState() elif self.state == 2: if self.cnt > 30: self.nextState() elif self.state == 3: self.rad += self.omega if self.rad > (math.pi +self.angle): self.nextState() elif self.state == 4: self.rad -= self.omega if self.rad < (math.pi -self.angle): self.nextState() elif self.state == 5: self.rad += self.omega if self.rad >= math.pi: self.rad = math.pi self.nextState() else: self.size -= 0.05 if self.size <= 0: self.remove() if self.removeFlag == False: self.xpolygonList1 = gcommon.getAnglePolygons2([self.x, self.y], self.polygonList1, [0,0], self.rad, 1, self.size) self.xpolygonList2 = gcommon.getAnglePolygons2([self.x, self.y], self.polygonList1, [0,0], self.rad, 1, self.size*0.8) self.xpolygonList3 = gcommon.getAnglePolygons2([self.x, self.y], self.polygonList1, [0,0], self.rad, 1, self.size/2) if self.cnt & 1 == 0: if self.rad > math.pi * 1.05: x = self.x - ((self.y -8)/ math.tan(self.rad)) if x > 0: enemy.create_explosion(x, 4 + random.randrange(8), gcommon.C_LAYER_EXP_SKY, gcommon.C_EXPTYPE_GRD_M) elif self.rad < math.pi * 0.95: x = self.x + ((184 -self.y)/ math.tan(self.rad)) if x > 0: enemy.create_explosion(x, 184 + random.randrange(8), gcommon.C_LAYER_EXP_SKY, gcommon.C_EXPTYPE_GRD_M)
def update(self): #self.radOffset -= math.pi * 0.05 #if self.radOffset < 0: # self.radOffset += 2 * math.pi self.radOffset += math.pi * 0.02 if self.radOffset > 2 * math.pi: self.radOffset -= 2 * math.pi if self.state == 0: if self.limit >= -10: self.limit -= 2 else: self.nextState() elif self.state == 1: if self.cnt > 40: self.nextState() self.beamRadStart = 0.0 elif self.state == 2: if self.beamRadDelta > -math.pi/120: self.beamRadDelta -= (math.pi/120/30) if self.beamRadStart < math.pi*0.35: self.beamRadStart += math.pi/200 if self.cnt > 150: self.nextState() elif self.state == 3: if self.beamRadDelta < math.pi/120: self.beamRadDelta += (math.pi/120/30) if self.beamRadStart > -math.pi*0.35: self.beamRadStart -= math.pi/200 if self.cnt > 150: self.stateCycle += 1 if self.stateCycle == 3: self.setState(10) else: self.setState(2) elif self.state == 10: if self.beamRadDelta > 0: self.beamRadDelta -= (math.pi/120/30) self.beamRadStart += math.pi/200 if self.beamRadStart >= 0: self.nextState() elif self.state == 11: if self.limit < 240: self.limit += 2 else: self.remove() # 描画準備 rad = self.radOffset x2 = self.x r = 0 beamRad = self.beamRadStart px = self.x py = self.y count = 0 for i in range(len(self.listArray)): self.listArray[i] = [] while(x2 > self.limit and count < 50): #y2 = py - math.sin(rad) * r pos = gcommon.getAngle(0, - math.sin(rad) * r, beamRad) x2 = px + pos[0] y2 = py + pos[1] n = int(rad / (math.pi/6)) % 12 #print(str(n)) if gcommon.isMapFreePos(x2, y2) == False and self.cnt & 3 == 0: enemy.create_explosion(x2, y2, gcommon.C_LAYER_GRD, gcommon.C_EXPTYPE_GRD_S) self.listArray[n].append([x2, y2]) # 奥から描画するために反転する if n in (8,9): self.listArray[n].reverse() rad += math.pi/4 if rad > math.pi*2: rad -= math.pi*2 if r < 40: r += 2 px += (math.cos(beamRad)* -8) py += (math.sin(beamRad)* -8) beamRad += self.beamRadDelta count += 1