コード例 #1
0
 def broken(self):
     for feeler in self.feelers:
         feeler.remove()
     for feelerShot in self.feelerShots:
         feelerShot.remove()
     for cell in self.bossCells:
         if cell.removeFlag == False:
             cell.remove()
     self.remove()
     enemy.removeEnemyShot()
     ObjMgr.objs.append(
         boss.BossExplosion(gcommon.getCenterX(self),
                            gcommon.getCenterY(self),
                            gcommon.C_LAYER_EXP_SKY))
     GameSession.addScore(self.score)
     BGM.sound(gcommon.SOUND_LARGE_EXP)
     enemy.Splash.append(gcommon.getCenterX(self), gcommon.getCenterY(self),
                         gcommon.C_LAYER_EXP_SKY)
     if self.isBossRush:
         gcommon.debugPrint("Boss2 call NextEvent")
         if self.timerObj != None:
             self.timerObj.stop()
             self.timerObj = None
         ObjMgr.objs.append(enemy.NextEvent([0, None, 240]))
     else:
         ObjMgr.objs.append(enemy.Delay(enemy.StageClear, None, 240))
コード例 #2
0
ファイル: boss.py プロジェクト: Ontake44/gra-den
	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
コード例 #3
0
 def broken(self):
     self.remove()
     enemy.removeEnemyShot()
     ObjMgr.objs.append(boss.BossExplosion(gcommon.getCenterX(self), gcommon.getCenterY(self), gcommon.C_LAYER_EXP_SKY))
     GameSession.addScore(self.score)
     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.objs.append(enemy.Delay(enemy.StageClear, None, 240))
コード例 #4
0
    def update(self):
        self.x -= self.speed
        if self.x <= -24 or self.x >= gcommon.SCREEN_MAX_X or self.y < -16 or self.y >= gcommon.SCREEN_MAX_Y:
            self.removeFlag = True

        if gcommon.isMapFreePos(gcommon.getCenterX(self),
                                gcommon.getCenterY(self)) == False:
            self.removeFlag = True
コード例 #5
0
 def broken(self):
     self.mode = 2
     self.setState(0)
     self.hitCheck = False
     self.shotHitCheck = False
     self.removeAllShot()
     enemy.removeEnemyShot()
     BGM.sound(gcommon.SOUND_LARGE_EXP)
     enemy.Splash.append(gcommon.getCenterX(self), gcommon.getCenterY(self), gcommon.C_LAYER_EXP_SKY)
     GameSession.addScore(self.score)
     if self.isBossRush:
         if self.timerObj != None:
             self.timerObj.stop()
             self.timerObj = None
コード例 #6
0
ファイル: boss.py プロジェクト: Ontake44/gra-den
	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()
コード例 #7
0
ファイル: boss.py プロジェクト: Ontake44/gra-den
	def broken(self):
		self.setState(100)
		# 当たり判定がないレイヤに移動しないと何度もbrokenが呼ばれてしまう
		self.layer = gcommon.C_LAYER_HIDE_GRD
		enemy.Splash.append(gcommon.getCenterX(self), gcommon.getCenterY(self), gcommon.C_LAYER_EXP_SKY)
		gcommon.sound(gcommon.SOUND_LARGE_EXP)
コード例 #8
0
ファイル: boss.py プロジェクト: Ontake44/gra-den
	def update(self):
		if self.state == 0:
			# 格納庫
			if self.cnt == 80:
				self.nextState()
		elif self.state == 1:
			# 初期位置まで移動
			if abs(self.firstY - self.y) < 1 and abs(self.firstX - self.x) < 1:
				self.nextState()
				self.dx = 0
				self.dy = 0
			else:
				r = math.atan2(self.firstY - self.y, self.firstX - self.x)
				self.dx = math.cos(r) * 1
				self.dy = math.sin(r) * 1
				self.x += self.dx
				self.y += self.dy

		elif self.state == 2:
			self.brake = False
			if self.cnt == 60:
				self.nextState()
		elif self.state == 3:
			self.x += self.dx
			self.y += self.dy
			self.brake = False
			mode = boss3Btbl[self.tblIndex][0]
			if mode == 0:
				if self.subcnt == boss3Btbl[self.tblIndex][3]:
					self.nextTbl()
			elif mode == 1:
				if self.x < boss3Btbl[self.tblIndex][3]:
					self.dx *= 0.95
					self.dy *= 0.95
					self.brake = True
					if abs(self.dx) < 0.01:
						self.nextTbl()
				else:
					self.addDxDy()
			elif mode == 2:
				if self.x > boss3Btbl[self.tblIndex][3]:
					self.dx *= 0.95
					self.dy *= 0.95
					self.brake = True
					if abs(self.dx) < 0.01:
						self.nextTbl()
				else:
					self.addDxDy()
			elif mode == 3:
				# 上制限(上移動)
				if self.y < boss3Btbl[self.tblIndex][3]:
					self.dx *= 0.95
					self.dy *= 0.95
					self.brake = True
					if abs(self.dy) <=0.01:
						self.nextTbl()
				else:
					self.addDxDy()
			elif mode == 4:
				# 下制限(下移動)
				if self.y > boss3Btbl[self.tblIndex][3]:
					self.dx *= 0.95
					self.dy *= 0.95
					self.brake = True
					if abs(self.dy) <= 0.01:
						self.nextTbl()
				else:
					self.addDxDy()

			attack = boss3Btbl[self.tblIndex][4]
			if attack == 1:
				# 全体攻撃
				if self.subcnt & 7 == 0:
					enemy.enemy_shot_dr(self.x +24, self.y + 18, 6, 1, 49 + (self.subcnt>>3)*2)
					enemy.enemy_shot_dr(self.x +24, self.y + 18, 6, 1, 47 - (self.subcnt>>3)*2)
					gcommon.sound(gcommon.SOUND_SHOT2)
			elif attack == 2:
				# 正面攻撃
				if self.subcnt & 15 == 0:
					enemy.enemy_shot_dr(self.x +24 +16, self.y + 32, 4, 1, 16)
					enemy.enemy_shot_dr(self.x +24 -16, self.y + 32, 4, 1, 16)
					gcommon.sound(gcommon.SOUND_SHOT2)
			elif attack == 3:
				# 波状攻撃
				if self.subcnt & 15 == 0:
					if self.subcnt & 31 == 0:
						for i in range(1,6):
							enemy.enemy_shot_offset(self.x+24, self.y+18, 2*2,1, -(i-2)*2)
						gcommon.sound(gcommon.SOUND_SHOT2)
					else:
						for i in range(1,6):
							enemy.enemy_shot_offset(self.x+24, self.y+18, 2*2,1, (i-2)*2)
						gcommon.sound(gcommon.SOUND_SHOT2)
			
			elif attack == 4:
				# 時計回り攻撃
				if self.subcnt & 7 == 0:
					enemy.enemy_shot_dr(self.x +24, self.y + 18, 5, 1, (self.subcnt>>3)+2)
					enemy.enemy_shot_dr(self.x +24, self.y + 18, 6, 1, (self.subcnt>>3)-2)
					gcommon.sound(gcommon.SOUND_SHOT2)

			elif attack == 5:
				# 反時計回り攻撃
				if self.subcnt & 7 == 0:
					enemy.enemy_shot_dr(self.x +24, self.y + 18, 6, 1, (34 -(self.subcnt>>3)))
					enemy.enemy_shot_dr(self.x +24, self.y + 18, 5, 1, (30 -(self.subcnt>>3)))
					gcommon.sound(gcommon.SOUND_SHOT2)
				
			self.subcnt+=1

		elif self.state == 100:
			# broken
			self.dx = 0
			self.dy = 0
			self.subcnt = 0
			if self.cnt > 120:
				gcommon.ObjMgr.objs.append(Boss3Explosion(gcommon.getCenterX(self), gcommon.getCenterY(self), gcommon.C_LAYER_EXP_GRD))
				gcommon.score+=self.score
				self.nextState()

		elif self.state == 101:
			if self.cnt > 300:
				self.nextState()

		elif self.state == 102:
			gcommon.ObjMgr.objs.append(enemy.StageClearText(3))
			if self.cnt > 240:
				self.nextState()

		elif self.state == 103:
			self.remove()
			gcommon.app.startGameClear()