Example #1
0
	def __init__(self, core):
		self.core = core
		
		self.rollAmount = 0
		self.drawParam = Std.Sprite.DrawParam()
		self.drawParam.src = Std.RectF(0, 0, 80, 64)
		self.drawParam.priority = Ctrl.DrawPriority.myShip
		self._setDrawParam()
		
		hitMarkerDrawParam = Std.Sprite.DrawParam()
		hitMarkerDrawParam.src = Std.RectF(0, 0, 32, 32)
		hitMarkerDrawParam.dst = core.position.makeRect(self.HIT_MARKER_SIZE, True)
		hitMarkerDrawParam.priority = Ctrl.DrawPriority.myShip4
		hitMarkerDrawParam.color.a = 0.8
		self.hitMarkerAnimation = createSequenceAnimation(
			core.resource.hitMarkerTexList, hitMarkerDrawParam)
		self.hitMarkerAnimation.play()
		
		backFireDrawParam = Std.Sprite.DrawParam()
		backFireDrawParam.src = Std.RectF(0, 0, 128, 128)
		backFireDrawParam.dst = self.backFirePos.makeRect(self.BACK_FIRE_SIZE, True)
		backFireDrawParam.priority = Ctrl.DrawPriority.myShipB2
		backFireDrawParam.color.a = 0.8
		backFireDrawParam.rotDegree = 180
		self.backFireAnimation = createSequenceAnimation(
			core.resource.backFireTexList, backFireDrawParam)
		self.backFireAnimation.play()
Example #2
0
	def __init__(self, stage):
		super().__init__(stage)
		self.eventCoroutine = Coroutine(self.updateEvent)
		self.resource = self.stageSetRef().resource
		self.scoreManager = self.stageSetRef().scoreManager
		self.scrolledEnemyList = []
		
		appearPos = Std.Vector2DF(0, -140)
		self.appearLocator = Std.Locator.LinearF(appearPos)
		self.appearLocator.speed.y = self.stageSetRef().scrollSpeed
		
		appearDrawParam = Std.Sprite.DrawParam()
		appearDrawParam.src = Std.RectF(0, 0, 440, 332)
		appearDrawParam.dst = self.appearLocator.position.makeRect(440, 332, False)
		appearDrawParam.priority = Ctrl.DrawPriority.background2
		self.appearAnimation = createSequenceAnimation(
			self.resource.st1_AppearTexList, appearDrawParam, 2)
		
		warningPos = Std.Vector2DF(220, 150)
		warningSize = Std.Vector2DF(400, 128) * 1.2
		warningDrawParam = Std.Sprite.DrawParam()
		warningDrawParam.src = Std.RectF(0, 0, 400, 128)
		warningDrawParam.dst = warningPos.makeRect(warningSize, True)
		warningDrawParam.priority = Ctrl.DrawPriority.warning
		self.warningAnimation = createSequenceAnimation(
			self.resource.warningTexList, warningDrawParam, 2)
Example #3
0
	def __init__(self, core):
		self.core = core
		
		spBeginDrawParam = Std.Sprite.DrawParam()
		spBeginDrawParam.src = Std.RectF(0, 0, 200, 200)
		spBeginDrawParam.dst = core.position.makeRect(self.SPBEGIN_SIZE, True)
		spBeginDrawParam.priority = Ctrl.DrawPriority.myShipB1
		self.spBeginAnimation = createSequenceAnimation(
			core.resource.spBeginTexList, spBeginDrawParam)
		
		spFinishDrawParam = Std.Sprite.DrawParam()
		spFinishDrawParam.src = Std.RectF(0, 0, 200, 200)
		spFinishDrawParam.dst = core.position.makeRect(self.SPFINISH_SIZE, True)
		spFinishDrawParam.priority = Ctrl.DrawPriority.myShipB1
		self.spFinishAnimation = createSequenceAnimation(
			core.resource.spFinishTexList, spFinishDrawParam)
		
		spFinishingDrawParam = Std.Sprite.DrawParam()
		spFinishingDrawParam.src = Std.RectF(0, 0, 200, 200)
		spFinishingDrawParam.dst = core.position.makeRect(self.SPFINISHING_SIZE, True)
		spFinishingDrawParam.priority = Ctrl.DrawPriority.myShipB1
		self.spFinishingAnimation = createSequenceAnimation(
			core.resource.spFinishingTexList, spFinishingDrawParam)
		
		spGaugeDrawParam = Std.Sprite.DrawParam()
		spGaugeDrawParam.src = Std.RectF(0, 0, 64, 64)
		spGaugeDrawParam.dst = core.position.makeRect(self.SPGAUGE_SIZE, True)
		spGaugeDrawParam.priority = Ctrl.DrawPriority.myShipB1
		self.spGaugeAnimation = createSequenceAnimation(
			core.resource.spGaugeTexList, spGaugeDrawParam)
Example #4
0
	def __init__(self, ship):
		self.ship = ship
		
		self.shipDrawParam = Std.Sprite.DrawParam()
		self.shipDrawParam.texture = self.ship.resource.shipTexture
		self.shipDrawParam.src = Std.RectF(0, 0, 64, 64)
		self.shipDrawParam.dst = ship.position.makeRect(ship.SHIP_SIZE, True)
		self.shipDrawParam.priority = Ctrl.DrawPriority.myShip
		
		self.hitMarkDrawParam = Std.Sprite.DrawParam()
		self.hitMarkDrawParam.texture = CommonResource.get("bulletRed")
		self.hitMarkDrawParam.src = Std.RectF(0, 0, 64, 64)
		self.hitMarkDrawParam.dst = ship.position.makeRect(self.HIT_MARK_SIZE, True)
		self.hitMarkDrawParam.priority = Ctrl.DrawPriority.myShipHitMark
		self.hitMarkDrawParam.alphaBlend = Std.Sprite.AlphaBlend.Add
		
		self.barrierDrawParam = Std.Sprite.DrawParam()
		self.barrierDrawParam.texture = CommonResource.get("bulletBlue")
		self.barrierDrawParam.src = Std.RectF(0, 0, 64, 64)
		self.barrierDrawParam.dst = ship.position.makeRect(self.BARRIER_SIZE, True)
		self.barrierDrawParam.priority = Ctrl.DrawPriority.myBarrier
		self.barrierDrawParam.alphaBlend = Std.Sprite.AlphaBlend.Add
		
		spBeginDrawParam = Std.Sprite.DrawParam()
		spBeginDrawParam.src = Std.RectF(0, 0, 200, 200)
		spBeginDrawParam.dst = ship.position.makeRect(self.SPBEGIN_ANIME_SIZE, True)
		spBeginDrawParam.priority = Ctrl.DrawPriority.myShip2
		self.spBeginAnimation = createSequenceAnimation(
			ship.resource.spBeginTextureList, spBeginDrawParam)
		
		spFinishDrawParam = Std.Sprite.DrawParam()
		spFinishDrawParam.src = Std.RectF(0, 0, 200, 200)
		spFinishDrawParam.dst = ship.position.makeRect(
			self.SPFINISH_ANIME_SIZE, True)
		spFinishDrawParam.priority = Ctrl.DrawPriority.myShip2
		self.spFinishAnimation = createSequenceAnimation(
			ship.resource.spFinishTextureList, spFinishDrawParam)
		
		spFinishingDrawParam = Std.Sprite.DrawParam()
		spFinishingDrawParam.src = Std.RectF(0, 0, 200, 200)
		spFinishingDrawParam.dst = ship.position.makeRect(
			self.SPFINISHING_ANIME_SIZE, True)
		spFinishingDrawParam.priority = Ctrl.DrawPriority.myShip2
		self.spFinishingAnimation = createSequenceAnimation(
			ship.resource.spFinishingTextureList, spFinishingDrawParam)
		
		spGaugeDrawParam = Std.Sprite.DrawParam()
		spGaugeDrawParam.src = Std.RectF(0, 0, 64, 64)
		spGaugeDrawParam.dst = ship.position.makeRect(
			self.SPGAUGE_ANIME_SIZE, True)
		spGaugeDrawParam.priority = Ctrl.DrawPriority.myShip2
		self.spGaugeAnimation = createSequenceAnimation(
			ship.resource.spGaugeTextureList, spGaugeDrawParam)
Example #5
0
	def __init__(self, pos, angle, resource, scoreManager, rank):
		self.regulation = Regulation.Bit(rank)
		
		super().__init__(
			Std.Hit.RectI(pos, self.SIZE, True), self.regulation.hp)
		self.setValidAreaMargin(50)
		
		self.locator = Std.Locator.TraceF(180)
		self.locator.position = pos
		
		self.circling = Std.CirclingF(self.CIRCLING_ANGLE)
		
		drawParam = Std.Sprite.DrawParam()
		drawParam.src = Std.RectF(0, 0, 52, 60)
		drawParam.dst = self.locator.position.makeRect(self.SIZE, True)
		drawParam.priority = Ctrl.DrawPriority.enemyB1
		self.animation = createSequenceAnimation(
			resource.st1_YunoBitTexList, drawParam)
		self.animation.play()
		
		self.angle = angle
		
		self.scoreManager = scoreManager
		
		self.se_Explode = resource.se_Explode1
Example #6
0
	def __init__(self, core, position, angle):
		super().__init__(position, self.RADIUS, self.BASE_DAMAGE)
		self.noDamage = True
		self.core = core
		self.prevValidArea = self.isHitRect(self.VALID_AREA)
		
		self.locator = Std.Locator.LinearF(position)
		self.locator.speed.setUnitVector(angle)
		self.locator.speed *= self.SPEED
		
		self.damageRateDec = self.DAMAGE_RATE_DEC
		self.damageRateMin = self.DAMAGE_RATE_MIN
		
		self.blast = PlasmaBlast(self.core, self.position)
		self.blasted = False
		
		drawParam = Std.Sprite.DrawParam()
		drawParam.src = Std.RectF(0, 0, 64, 64)
		drawParam.dst = position.makeRect(self.SIZE, True)
		drawParam.priority = Ctrl.DrawPriority.myShot
		self.animation = createSequenceAnimation(
			core.resource.plasmaBallTexList, drawParam)
		rand = Ctrl.getRandom()
		self.animation.play(
			rand.getInt(0, self.animation.frameHolder.frameNum - 1))
		
		self.se_PlasmaBlast = core.resource.se_PlasmaBlast
Example #7
0
def createLockOptionShot(core, pos, angle):
	speed = Regulation.lockOptionShotSpeed
	radius = 8
	
	drawParam = Std.Sprite.DrawParam()
	drawParam.texture = core.resource.lockOptionShot
	drawParam.src = Std.RectF(0, 0, 28, 80)
	drawParam.dst = pos.makeRect(radius*2, 80, True)
	drawParam.priority = Ctrl.DrawPriority.myShot
	drawParam.rotDegree = angle + 90
	
	baseDamage = Regulation.lockOptionShotBaseDamage
	damageRateDec = Regulation.lockOptionShotDamageRateDecrease
	damageRateMin = Regulation.lockOptionShotDamageRateMin
	paBaseDamage = Regulation.lockOptionShotPABaseDamage
	
	vanishDrawParam = Std.Sprite.DrawParam()
	vanishDrawParam.src = Std.RectF(0, 0, 128, 128)
	vanishDrawParam.dst = pos.makeRect(48, 96, True)
	vanishDrawParam.priority = Ctrl.DrawPriority.myShot
	vanishAnimation = createSequenceAnimation(
		core.resource.lockOptionShotParticleTexList, vanishDrawParam)
	
	shot = createSimpleShot(
		pos, angle, speed, radius, 
		baseDamage, damageRateDec, damageRateMin, paBaseDamage, 
		drawParam, 90, vanishAnimation, 
		core.resource.se_ShotHit)
	shot.hp = Regulation.lockOptionShotAttenuationResistance
Example #8
0
def createNormalShot(core, pos, angle, damage, paDamage, shotHp):
	speed = Regulation.normalShotSpeed
	radius = 8
	damageRateDec = Regulation.normalShotDamageRateDecrease
	damageRateMin = Regulation.normalShotDamageRateMin
	
	drawParam = Std.Sprite.DrawParam()
	drawParam.texture = core.resource.normalShot
	drawParam.src = Std.RectF(0, 0, 28, 80)
	drawParam.dst = pos.makeRect(radius*2, 80, True)
	drawParam.priority = Ctrl.DrawPriority.myShot
	drawParam.rotDegree = angle + 90
	
	vanishDrawParam = Std.Sprite.DrawParam()
	vanishDrawParam.src = Std.RectF(0, 0, 128, 128)
	vanishDrawParam.dst = pos.makeRect(48, 96, True)
	vanishDrawParam.priority = Ctrl.DrawPriority.myShot
	vanishAnimation = createSequenceAnimation(
		core.resource.normalShotParticleTexList, vanishDrawParam)
	
	shot = createSimpleShot(
		pos, angle, speed, radius, 
		damage, damageRateDec, damageRateMin, paDamage, 
		drawParam, 90, vanishAnimation, 
		core.resource.se_ShotHit)
	shot.hp = shotHp
Example #9
0
	def __init__(self, core):
		self.core = core
		self.faceNumber = 0
		self.sideL_valid = True
		self.sideR_valid = True
		
		self.baseDrawParam = Std.Sprite.DrawParam()
		self.baseDrawParam.texture = core.resource.st1_YunoBase
		self.baseDrawParam.src = Std.RectF(0, 0, 
			self.BASE_SIZE.x, self.BASE_SIZE.y)
		self.baseDrawParam.dst = core.locator.position.makeRect(
			self.BASE_SIZE, True)
		self.baseDrawParam.priority = Ctrl.DrawPriority.enemy
		
		rotorDrawParam = Std.Sprite.DrawParam()
		rotorDrawParam.src = Std.RectF(0, 0, 
			self.BASE_SIZE.x, self.BASE_SIZE.y)
		rotorDrawParam.dst = core.locator.position.makeRect(
			self.BASE_SIZE, True)
		rotorDrawParam.priority = Ctrl.DrawPriority.enemy3
		self.rotorAnimation = createSequenceAnimation(
			self.core.resource.st1_YunoRotorTexList, rotorDrawParam)
		self.rotorAnimation.play()
		
		self.sideLDrawParam = Std.Sprite.DrawParam(self.baseDrawParam)
		self.sideLDrawParam.texture = core.resource.st1_YunoSide_L
		self.sideLDrawParam.priority = Ctrl.DrawPriority.enemy2
		
		self.sideRDrawParam = Std.Sprite.DrawParam(self.baseDrawParam)
		self.sideRDrawParam.texture = core.resource.st1_YunoSide_R
		self.sideRDrawParam.priority = Ctrl.DrawPriority.enemy2
		
		self.smokeRepCounter = Std.RepeatCounter(2)
Example #10
0
	def addLock(self, enemy, damage):
		optionNum = len(self.core.optionManager.optionList)
		if len(self.lockedList) < optionNum:
			index = 0
			while index < len(self.lockingList):
				en, dam = self.lockingList[index]
				
				if en.objectId == enemy.objectId:
					dam += damage * (self.paralellLoad ** len(self.lockedList))
					
					if dam >= self.lockThresHold:
						self.lockedList.append(en)
						
						if len(self.lockedList) == optionNum:
							self.lockingList = []
						else:
							del self.lockingList[index]
						
						drawParam = Std.Sprite.DrawParam()
						drawParam.src = Std.RectF(0, 0, 64, 64)
						drawParam.dst = en.position.makeRect(
							self.LOCK_BEGIN_ANIMATION_SIZE, True)
						drawParam.priority = Ctrl.DrawPriority.lockMarker2
						lockBeginAnimation = createSequenceAnimation(
							self.core.resource.lockBeginTexList, drawParam)
						lockBeginAnimation.play()
						self.lockBeginAnimationList.append((en, lockBeginAnimation))
						
						drawParam = Std.Sprite.DrawParam(drawParam)
						drawParam.dst = en.position.makeRect(
							self.LOCK_MARKER_SIZE, True)
						drawParam.priority = Ctrl.DrawPriority.lockMarker
						lockMarkerAnimation = createSequenceAnimation(
							self.core.resource.lockMarkerTexList, drawParam)
						lockMarkerAnimation.play()
						self.lockMarkerAnimationDict[en.objectId] = (en, lockMarkerAnimation)
						
						self.se_Lock.play()
					else:
						self.lockingList[index][1] = dam
					break
				index += 1
			else:
				if len(self.lockingList) < optionNum:
					self.lockingList.append([enemy, damage])
Example #11
0
def createSpNormalShot(core, pos, angle, 
					damage, paDamage, damageToBullet, shotHp, 
					damageKickbackRateToBullet = 1.0):
	speed = Regulation.spNormalShotSpeed
	radius = 32
	damageRateDec = Regulation.spNormalShotDamageRateDecrease
	damageRateMin = Regulation.spNormalShotDamageRateMin
	
	rand = Ctrl.getRandom()
	drawParam = Std.Sprite.DrawParam()
	drawParam.texture = core.resource.spNormalShot
	drawParam.src = Std.RectF(0, 0, 128, 256)
	drawParam.dst = pos.makeRect(radius*2, 96, True)
	drawParam.priority = Ctrl.DrawPriority.myShot
	drawParam.rotDegree = angle + 90
	drawParam.alphaBlend = Std.Sprite.AlphaBlend.Add
	drawParam.color.a = 0.6
	if rand.getBool():
		drawParam.flipX()
	
	particleSize = Std.Vector2DF(radius*6, radius*6)
	vanishDrawParam = Std.Sprite.DrawParam()
	vanishDrawParam.src = Std.RectF(0, 0, 128, 128)
	vanishDrawParam.dst = pos.makeRect(particleSize, True)
	vanishDrawParam.priority = Ctrl.DrawPriority.myShot
	vanishDrawParam.alphaBlend = Std.Sprite.AlphaBlend.Add
	vanishDrawParam.color.a = 0.3
	if rand.getBool():
		vanishDrawParam.flipX()
	vanishAnimation = createSequenceAnimation(
		core.resource.spNormalParticleTexList, vanishDrawParam)
	vanishAnimation.frameInterval = 0.4
	
	shot = createSimpleShot(
		pos, angle, speed, radius, 
		damage, damageRateDec, damageRateMin, paDamage, 
		drawParam, 90, vanishAnimation, 
		core.resource.se_ShotHit)
	shot.hp = shotHp
	
	shot.damageToBullet = damageToBullet
	shot.damageKickbackRateToBullet = damageKickbackRateToBullet
	def damageToBulletCallback(locator):
		drawParam = Std.Sprite.DrawParam(vanishDrawParam)
		drawParam.rotDegree = locator.speed.getAngle() + 90
		drawParam.alphaBlend = Std.Sprite.AlphaBlend.Add
		drawParam.color.a = 0.3
		if rand.getBool():
			drawParam.flipX()
		animation = createSequenceAnimation(
			core.resource.spNormalParticleTexList, drawParam)
		animation.frameInterval = 0.4
		
		rect = Std.Hit.RectI(locator.position, particleSize, True)
		animeObj = Auxs.Animation(rect, animation)
		Ctrl.Actor.registerActor(animeObj)
	shot.setDamageToBulletCallback(damageToBulletCallback)
Example #12
0
    def __init__(self, core):
        self.core = core
        self._enabled = True
        self.amount = self.CAPACITY
        self.generated = True
        self.hitCircle = Std.Hit.CircleI(core.position, self.RADIUS)

        self.damagedDrawParamList = []
        self.damagedEffectCount = 0

        drawParam = Std.Sprite.DrawParam()
        drawParam.src = Std.RectF(0, 0, 128, 128)
        drawParam.priority = Ctrl.DrawPriority.paEffect
        drawParam.alphaBlend = Std.Sprite.AlphaBlend.Add
        self.generatedAnimation = createSequenceAnimation(core.resource.paGeneratedTexList, drawParam)

        drawParam = Std.Sprite.DrawParam(drawParam)
        self.vanishedAnimation = createSequenceAnimation(core.resource.paVanishedTexList, drawParam)

        self.se_generate = core.resource.se_GeneratePA
Example #13
0
    def __init__(self, core, pos, target):
        super().__init__(core, pos, target)

        self.launcher = Launcher(self)
        self.launchable = False

        drawParam = Std.Sprite.DrawParam()
        drawParam.src = Std.RectF(0, 0, 48, 48)
        drawParam.dst = self.pos.makeRect(self.SIZE, True)
        drawParam.priority = Ctrl.DrawPriority.myShipOption
        drawParam.rotDegree = self.circling.angle + 90
        self.animation = createSequenceAnimation(core.resource.optionTexList, drawParam)
Example #14
0
	def damageToBulletCallback(locator):
		drawParam = Std.Sprite.DrawParam(vanishDrawParam)
		drawParam.rotDegree = locator.speed.getAngle() + 90
		drawParam.alphaBlend = Std.Sprite.AlphaBlend.Add
		drawParam.color.a = 0.3
		if rand.getBool():
			drawParam.flipX()
		animation = createSequenceAnimation(
			core.resource.spLockOptionParticleTexList, drawParam)
		animation.frameInterval = 0.4
		
		rect = Std.Hit.RectI(locator.position, particleSize, True)
		animeObj = Auxs.Animation(rect, animation)
		Ctrl.Actor.registerActor(animeObj)
Example #15
0
	def onErase(self):
		dst = self.position.makeRect(self.particleSize, True)
		drawParam = Std.Sprite.DrawParam()
		drawParam.src = Std.RectF(0, 0, 128, 128)
		drawParam.dst = dst
		drawParam.priority = Ctrl.DrawPriority.myShot
		drawParam.rotDegree = self.drawParam.rotDegree
		if self.toggle:
			texList = self.core.resource.lockMainParticleTexList_1
		else:
			texList = self.core.resource.lockMainParticleTexList_2
		animation = createSequenceAnimation(texList, drawParam)
		animation.frameInterval = 0.6
		animeObj = Auxs.Animation(Std.Hit.RectI(dst), animation)
		Ctrl.Actor.registerActor(animeObj)
Example #16
0
	def __init__(self, core, position):
		super().__init__(position, self.RADIUS, self.BASE_DAMAGE)
		self.noDamage = True
		self.locator = Std.Locator.LinearF(position)
		self.paBaseDamage = self.PA_BASE_DAMAGE
		self.forcibleForPA = True
		self.frameCounnt = self.LONGEVITY
		
		drawParam = Std.Sprite.DrawParam()
		drawParam.src = Std.RectF(0, 0, 128, 128)
		drawParam.dst = position.makeRect(self.SIZE, True)
		drawParam.priority = Ctrl.DrawPriority.myShot
		self.animation = createSequenceAnimation(
			core.resource.plasmaBlastTexList, drawParam)
		rand = Ctrl.getRandom()
		self.animation.play(
			rand.getInt(0, self.animation.frameHolder.frameNum - 1))
Example #17
0
    def __init__(self, core):
        self.core = core

        self.rollAmount = 0
        self.frameCount = 0
        self.drawParam = Std.Sprite.DrawParam()
        self.drawParam.src = Std.RectF(0, 0, 80, 64)
        self.drawParam.priority = Ctrl.DrawPriority.myShip
        self._setDrawParam()

        hitMarkerDrawParam = Std.Sprite.DrawParam()
        hitMarkerDrawParam.src = Std.RectF(0, 0, 32, 32)
        hitMarkerDrawParam.dst = core.position.makeRect(self.HIT_MARKER_SIZE, True)
        hitMarkerDrawParam.priority = Ctrl.DrawPriority.myShip4
        hitMarkerDrawParam.color.a = 0.8
        self.hitMarkerAnimation = createSequenceAnimation(core.resource.hitMarkerTexList, hitMarkerDrawParam)
        self.hitMarkerAnimation.play()