Code Sketch
bhavesh shahare
cleari()
originBottomLeft()
val ENGINE_VERSION = "V11.0-ULTRA-CINEMATIC"
val MAX_STARS_COUNT = 500
val MAX_PARTICLE_CAP = 1300
val MAX_TRAIL_LENGTH = 32
val MAX_SHOCKWAVES = 80
val MAX_SPARKS = 700
var currentGameState = 0
var briefingIndex = 0
var briefingDelta = 0.0
var universalClock = 0.0
var globalElapsedTime = 0.0
var combatTimer = 100.0
var scoreDestroyedCount = 0
val quotaRequirement = 35
var commanderHP = 100.0
var screenShakeMagnitude = 0.0
var globalColorFlash = 0.0
var redAlertAmount = 0.0
var whitePulse = 0.0
var cinematicBars = 0.0
var cinematicFade = 0.0
var dangerPulse = 0.0
var cameraDriftX = 0.0
var cameraDriftY = 0.0
var defenseTankPosX = cwidth / 2.0 + 90.0
val defenseTankPosY = 32.0
var mainTurretAngle = math.Pi / 2.0
var tankRecoilAmount = 0.0
var cannonMuzzleFlashTimer = 0
var mainGunCooldownTimer = 0
var tankHeat = 0.0
var tankEnginePulse = 0.0
var commandoPosX = cwidth / 2.0 - 250.0
var commandoPosY = 40.0
var commandoState = "WALK"
var commanderWalkPhase = 0.0
var siloXPos = cwidth / 2.0 - 260.0
var siloYPos = 145.0
var siloLauncherRotation = math.Pi / 2.0
var activeMissileTypeScript = 1
var siloLaunchCooldownTimer = 0
var missileLaunchFlash = 0.0
var akashBatteryX = cwidth / 2.0 - 90.0
var akashBatteryY = 110.0
var pinakaBatteryX = cwidth / 2.0 + 200.0
var pinakaBatteryY = 120.0
var pinakaSalvoCooldown = 0
var akashScanAngle = 0.0
var pinakaPulse = 0.0
var radarRotationAngle = 0.0
var radarPulse = 0.0
var flagshipBossActive = false
var flagshipBossHP = 800.0
val flagshipBossMaxHP = 800.0
var flagshipBossX = cwidth / 2.0
var flagshipBossY = cheight - 145.0
var bossMovementPhase = 0.0
var bossShield = 100.0
var bossPhase = 1
var bossWarningTimer = 0.0
var bossWeaponFlash = 0.0
var bossCorePulse = 0.0
var ultimateStrikeX = 0.0
var ultimateStrikeY = 0.0
var ultimateStrikeAngle = math.Pi / 2.0
var ultimateStrikeSpeed = 9.0
var ultimateExhaustPulse = 0.0
val briefingText =
"TOP SECRET DIRECTIVE: OPERATION SINDOOR\n" +
"DEFENSE STRATEGIC COMMAND NETWORK\n\n" +
"MULTIPLE HOSTILE SIGNALS DETECTED.\n" +
"PERIMETER DEFENSE STATUS: CRITICAL.\n\n" +
"AKASH AIR DEFENSE: ONLINE\n" +
"PINAKA ROCKET GRID: ONLINE\n" +
"MAIN BATTLE TANK: READY\n" +
"QUANTUM COMMAND LINK: STABLE\n\n" +
"PRIMARY OBJECTIVE:\n" +
"DEFEND THE SECTOR.\n" +
"NEUTRALIZE HOSTILE WAVES.\n" +
"DEFEAT THE FLAGSHIP.\n\n" +
"INITIALIZE HYPER DEFENSE TO BEGIN."
var audioEngineEnabled = false
try {
setNoteInstrument(Instrument.SYNTH_STRINGS)
audioEngineEnabled = true
} catch {
case _: Exception =>
audioEngineEnabled = false
}
def playTacticalTone(noteVal: Int, durationMillis: Int): Unit = {
if (audioEngineEnabled) {
try {
playNote(noteVal, durationMillis)
} catch {
case _: Exception =>
}
}
}
val starXCoords = Array.fill(MAX_STARS_COUNT)(randomDouble(0.0, cwidth))
val starYCoords = Array.fill(MAX_STARS_COUNT)(randomDouble(70.0, cheight))
val starSizes = Array.fill(MAX_STARS_COUNT)(randomDouble(0.4, 3.6))
val starTwinkleSpeeds = Array.fill(MAX_STARS_COUNT)(randomDouble(0.6, 6.0))
val starDepth = Array.fill(MAX_STARS_COUNT)(randomDouble(0.25, 1.0))
case class QuantumParticle(
var posX: Double,
var posY: Double,
var velX: Double,
var velY: Double,
var lifeSpan: Double,
val red: Int,
val green: Int,
val blue: Int,
var scaleFactor: Double,
val gravity: Double,
val drag: Double
)
val activeParticleSystem = ArrayBuffer.empty[QuantumParticle]
def spawnParticleExplosion(x: Double, y: Double, red: Int, green: Int, blue: Int, count: Int): Unit = {
for (_ <- 0 until count) {
if (activeParticleSystem.length < MAX_PARTICLE_CAP) {
activeParticleSystem.append(
QuantumParticle(
x,
y,
randomDouble(-9.0, 9.0),
randomDouble(-8.0, 9.0),
1.0,
red,
green,
blue,
randomDouble(2.0, 8.5),
randomDouble(-0.04, 0.05),
randomDouble(0.94, 0.985)
)
)
}
}
}
def spawnDirectionalParticles(x: Double, y: Double, angle: Double, red: Int, green: Int, blue: Int, count: Int): Unit = {
for (_ <- 0 until count) {
if (activeParticleSystem.length < MAX_PARTICLE_CAP) {
val spread = randomDouble(-0.55, 0.55)
val speed = randomDouble(2.0, 7.0)
val a = angle + spread
activeParticleSystem.append(
QuantumParticle(
x,
y,
math.cos(a) * speed,
math.sin(a) * speed,
1.0,
red,
green,
blue,
randomDouble(2.0, 7.0),
randomDouble(-0.02, 0.04),
randomDouble(0.94, 0.985)
)
)
}
}
}
def updateParticleSystem(): Unit = {
activeParticleSystem.filterInPlace(_.lifeSpan > 0.0)
activeParticleSystem.foreach { p =>
p.posX += p.velX
p.posY += p.velY
p.velY += p.gravity
p.velX *= p.drag
p.velY *= p.drag
p.lifeSpan -= 0.018
p.scaleFactor *= 0.985
}
}
def renderParticleSystem(c: CanvasDraw): Unit = {
activeParticleSystem.foreach { p =>
val alphaVal = math.max(0, math.min(255, (p.lifeSpan * 255.0).toInt))
c.fill(p.red, p.green, p.blue, alphaVal)
c.noStroke()
c.ellipse(p.posX, p.posY, p.scaleFactor, p.scaleFactor)
}
}
class TacticalSpark(xPos: Double, yPos: Double, r: Int, g: Int, b: Int) {
var px = xPos
var py = yPos
var vx = randomDouble(-11.0, 11.0)
var vy = randomDouble(-11.0, 11.0)
var life = 1.0
def update(): Unit = {
px += vx
py += vy
vx *= 0.89
vy *= 0.89
life -= 0.035
}
def render(c: CanvasDraw): Unit = {
if (life > 0.0) {
val alpha = math.max(0, math.min(255, (life * 255.0).toInt))
c.fill(r, g, b, alpha)
c.noStroke()
c.ellipse(px, py, 4.0 + life * 4.0, 4.0 + life * 4.0)
}
}
}
val tacticalSparks = ArrayBuffer.empty[TacticalSpark]
class ShockwaveRing(val cx: Double, val cy: Double, val ringColor: Int) {
var radius = 5.0
var alphaVal = 255.0
var active = true
def update(): Unit = {
radius += 10.0
alphaVal -= 13.0
if (alphaVal <= 0.0) active = false
}
def render(c: CanvasDraw): Unit = {
if (active) {
c.noFill()
if (ringColor == 0) {
c.stroke(0, 240, 255, math.max(0, math.min(255, alphaVal.toInt)))
} else if (ringColor == 1) {
c.stroke(255, 170, 50, math.max(0, math.min(255, alphaVal.toInt)))
} else {
c.stroke(255, 50, 50, math.max(0, math.min(255, alphaVal.toInt)))
}
c.strokeWeight(3.0)
c.ellipse(cx, cy, radius * 2.0, radius * 2.0)
}
}
}
val shockwaveRings = ArrayBuffer.empty[ShockwaveRing]
class EnergyArc(val x1: Double, val y1: Double, val x2: Double, val y2: Double) {
var life = 1.0
def update(): Unit = life -= 0.08
def render(c: CanvasDraw): Unit = {
if (life > 0.0) {
c.stroke(0, 255, 255, math.max(0, math.min(255, (life * 255.0).toInt)))
c.strokeWeight(1.5 + life * 3.0)
c.line(x1, y1, x2, y2)
}
}
}
val energyArcs = ArrayBuffer.empty[EnergyArc]
class OrbitRing(val x: Double, val y: Double, val size: Double, val speed: Double, val phase: Double) {
var life = 1.0
def update(): Unit = life -= 0.005
def render(c: CanvasDraw): Unit = {
val a = 90.0 + math.abs(math.sin(universalClock * speed + phase)) * 100.0
c.noFill()
c.stroke(0, 220, 255, math.max(0, math.min(255, a.toInt)))
c.strokeWeight(1.5)
c.ellipse(x, y, size + math.sin(universalClock * speed + phase) * 5.0, size * 0.45)
}
}
val orbitRings = ArrayBuffer.empty[OrbitRing]
class TankShell(var posX: Double, var posY: Double, val vx: Double, val vy: Double) {
var active = true
val trail = ArrayBuffer.empty[(Double, Double)]
def update(): Unit = {
posX += vx
posY += vy
trail.append((posX, posY))
if (trail.length > 14) trail.remove(0)
if (posX < -80 || posX > cwidth + 80 || posY < -80 || posY > cheight + 80) active = false
}
def render(c: CanvasDraw): Unit = {
var i = 0
while (i < trail.length) {
val p = trail(i)
val alpha = (i.toDouble / trail.length * 180.0).toInt
c.fill(255, 150, 30, alpha)
c.noStroke()
c.ellipse(p._1, p._2, 4.0, 4.0)
i += 1
}
c.fill(255, 245, 170)
c.noStroke()
c.ellipse(posX, posY, 12.0, 12.0)
}
}
val tankShells = ArrayBuffer.empty[TankShell]
class EnemyDrone(var posX: Double, var posY: Double, val speedY: Double, val pattern: Int) {
var active = true
var destroyed = false
var rotation = 0.0
var hp = 1
val trail = ArrayBuffer.empty[(Double, Double)]
def update(): Unit = {
if (!destroyed) {
posY += speedY
rotation += 0.07
if (pattern == 1) posX += math.sin(universalClock * 4.0 + posY * 0.02) * 3.0
if (pattern == 2) posX += math.sin(universalClock * 6.0 + posY * 0.02) * 5.0
if (pattern == 3) posX += math.cos(universalClock * 7.0 + posY * 0.025) * 7.0
if (pattern == 4) posX += math.sin(universalClock * 10.0 + posY * 0.04) * 9.0
trail.append((posX, posY))
if (trail.length > MAX_TRAIL_LENGTH) trail.remove(0)
if (posY < -100.0) active = false
}
}
def render(c: CanvasDraw): Unit = {
if (!destroyed) {
var i = 0
while (i < trail.length) {
val p = trail(i)
val alpha = (i.toDouble / trail.length * 180.0).toInt
c.fill(255, 50, 60, alpha)
c.noStroke()
c.ellipse(p._1, p._2, 4.0, 4.0)
i += 1
}
c.pushMatrix()
c.translate(posX, posY)
c.rotate(math.sin(rotation) * 0.18)
c.fill(75, 15, 20)
c.stroke(145, 20, 30)
c.strokeWeight(1.5)
c.rect(-28, -7, 56, 14)
c.fill(210, 40, 45)
c.rect(-17, -13, 34, 26)
c.fill(255, 170, 50)
c.noStroke()
c.ellipse(21, 0, 14, 14)
c.fill(255, 70, 30, 190)
c.ellipse(-20, 0, 10, 10)
c.popMatrix()
}
}
}
val enemyDrones = ArrayBuffer.empty[EnemyDrone]
class InterceptorMissile(var posX: Double, var posY: Double, val speed: Double, var angle: Double, val classType: Int) {
var active = true
val trail = ArrayBuffer.empty[(Double, Double)]
def update(): Unit = {
if (classType == 2) angle += 0.025
if (classType == 3) angle += math.sin(universalClock * 8.0) * 0.05
posX += math.cos(angle) * speed
posY += math.sin(angle) * speed
trail.append((posX, posY))
if (trail.length > MAX_TRAIL_LENGTH) trail.remove(0)
if (posX < -150 || posX > cwidth + 150 || posY < -150 || posY > cheight + 150) active = false
spawnDirectionalParticles(posX - math.cos(angle) * 20.0, posY - math.sin(angle) * 20.0, angle + math.Pi, 70, 210, 255, 1)
}
def render(c: CanvasDraw): Unit = {
var i = 0
while (i < trail.length) {
val p = trail(i)
val alpha = (i.toDouble / trail.length * 215.0).toInt
if (classType == 1) c.fill(0, 255, 230, alpha)
else if (classType == 2) c.fill(255, 170, 40, alpha)
else c.fill(255, 70, 40, alpha)
c.noStroke()
c.ellipse(p._1, p._2, 5.0, 5.0)
i += 1
}
c.pushMatrix()
c.translate(posX, posY)
c.rotate(angle)
c.fill(235, 250, 255)
c.stroke(0, 110, 150)
c.strokeWeight(1.2)
c.rect(-25, -7, 50, 14)
c.fill(0, 245, 255)
c.noStroke()
c.ellipse(25, 0, 15, 15)
c.fill(255, 255, 255)
c.ellipse(-12, 0, 7, 7)
c.popMatrix()
}
}
val interceptorMissiles = ArrayBuffer.empty[InterceptorMissile]
def addExplosion(x: Double, y: Double, power: Int): Unit = {
shockwaveRings.append(new ShockwaveRing(x, y, 1))
if (shockwaveRings.length > MAX_SHOCKWAVES) shockwaveRings.remove(0)
spawnParticleExplosion(x, y, 255, 190, 50, power)
spawnParticleExplosion(x, y, 255, 70, 30, power / 2)
var n = 0
while (n < power) {
if (tacticalSparks.length < MAX_SPARKS) tacticalSparks.append(new TacticalSpark(x, y, 255, random(120, 255), 50))
n += 1
}
screenShakeMagnitude = math.max(screenShakeMagnitude, 8.0 + power * 0.2)
globalColorFlash = math.max(globalColorFlash, 0.25 + power * 0.01)
}
def triggerCataclysmicExplosion(x: Double, y: Double): Unit = {
addExplosion(x, y, 30)
shockwaveRings.append(new ShockwaveRing(x, y, 0))
spawnParticleExplosion(x, y, 255, 255, 220, 16)
playTacticalTone(55, 70)
}
def triggerMegaExplosion(x: Double, y: Double): Unit = {
addExplosion(x, y, 50)
shockwaveRings.append(new ShockwaveRing(x, y, 0))
shockwaveRings.append(new ShockwaveRing(x, y, 2))
spawnParticleExplosion(x, y, 255, 255, 220, 24)
globalColorFlash = 0.55
screenShakeMagnitude = 18.0
playTacticalTone(42, 90)
}
def fireMainGun(): Unit = {
if (mainGunCooldownTimer <= 0) {
val muzzleX = defenseTankPosX + math.cos(mainTurretAngle) * 94.0
val muzzleY = defenseTankPosY + 59.0 + math.sin(mainTurretAngle) * 94.0
tankShells.append(new TankShell(muzzleX, muzzleY, math.cos(mainTurretAngle) * 14.0, math.sin(mainTurretAngle) * 14.0))
mainGunCooldownTimer = 8
cannonMuzzleFlashTimer = 6
tankRecoilAmount = 3.5
tankHeat += 12.0
missileLaunchFlash = 0.12
spawnDirectionalParticles(muzzleX, muzzleY, mainTurretAngle + math.Pi, 255, 180, 70, 10)
screenShakeMagnitude = 4.0
playTacticalTone(72, 40)
}
}
def launchMissile(): Unit = {
if (siloLaunchCooldownTimer <= 0) {
var speed = 9.0
if (activeMissileTypeScript == 2) speed = 8.0
if (activeMissileTypeScript == 3) speed = 11.5
val sx = siloXPos + math.cos(siloLauncherRotation) * 65.0
val sy = siloYPos + math.sin(siloLauncherRotation) * 65.0
interceptorMissiles.append(new InterceptorMissile(sx, sy, speed, siloLauncherRotation, activeMissileTypeScript))
siloLaunchCooldownTimer = 12
missileLaunchFlash = 1.0
spawnDirectionalParticles(sx, sy, siloLauncherRotation + math.Pi, 255, 120, 40, 16)
screenShakeMagnitude = 3.0
playTacticalTone(68, 50)
}
}
def handleInteractiveControls(): Unit = {
if (currentGameState != 2 && currentGameState != 3) return
if (!isMousePressed) return
val mx = mouseX
val my = mouseY
if (mx >= 20 && mx <= 70 && my >= 90 && my <= 125) {
defenseTankPosX -= 6.0
} else if (mx >= 75 && mx <= 125 && my >= 90 && my <= 125) {
defenseTankPosX += 6.0
} else if (mx >= 130 && mx <= 180 && my >= 90 && my <= 125) {
mainTurretAngle -= 0.06
} else if (mx >= 185 && mx <= 235 && my >= 90 && my <= 125) {
mainTurretAngle += 0.06
} else if (mx >= 240 && mx <= 315 && my >= 90 && my <= 125) {
fireMainGun()
} else if (mx >= 320 && mx <= 365 && my >= 90 && my <= 125) {
siloLauncherRotation -= 0.06
} else if (mx >= 370 && mx <= 415 && my >= 90 && my <= 125) {
siloLauncherRotation += 0.06
} else if (mx >= 420 && mx <= 465 && my >= 90 && my <= 125) {
activeMissileTypeScript = 1
} else if (mx >= 470 && mx <= 515 && my >= 90 && my <= 125) {
activeMissileTypeScript = 2
} else if (mx >= 520 && mx <= 565 && my >= 90 && my <= 125) {
activeMissileTypeScript = 3
} else if (mx >= 570 && mx <= 700 && my >= 90 && my <= 125) {
launchMissile()
}
}
def evaluateCombatCollisions(): Unit = {
repeatFor(enemyDrones) { drone =>
if (!drone.destroyed) {
repeatFor(tankShells) { shell =>
if (shell.active && math.abs(shell.posX - drone.posX) < 40.0 && math.abs(shell.posY - drone.posY) < 40.0) {
shell.active = false
drone.destroyed = true
scoreDestroyedCount += 1
triggerCataclysmicExplosion(drone.posX, drone.posY)
}
}
repeatFor(interceptorMissiles) { missile =>
if (missile.active && math.abs(missile.posX - drone.posX) < 48.0 && math.abs(missile.posY - drone.posY) < 48.0) {
missile.active = false
drone.destroyed = true
scoreDestroyedCount += 1
triggerCataclysmicExplosion(drone.posX, drone.posY)
}
}
}
}
if (flagshipBossActive) {
repeatFor(tankShells) { shell =>
if (shell.active && math.abs(shell.posX - flagshipBossX) < 75.0 && math.abs(shell.posY - flagshipBossY) < 65.0) {
shell.active = false
if (bossShield > 0.0) bossShield -= 8.0 else flagshipBossHP -= 18.0
triggerCataclysmicExplosion(shell.posX, shell.posY)
}
}
repeatFor(interceptorMissiles) { missile =>
if (missile.active && math.abs(missile.posX - flagshipBossX) < 78.0 && math.abs(missile.posY - flagshipBossY) < 68.0) {
missile.active = false
if (bossShield > 0.0) bossShield -= 18.0 else flagshipBossHP -= 38.0
triggerCataclysmicExplosion(missile.posX, missile.posY)
}
}
if (bossShield < 0.0) bossShield = 0.0
}
}
def refreshAllEntities(): Unit = {
tankShells.filterInPlace(_.active)
repeatFor(tankShells)(_.update())
interceptorMissiles.filterInPlace(_.active)
repeatFor(interceptorMissiles)(_.update())
enemyDrones.filterInPlace(_.active)
repeatFor(enemyDrones)(_.update())
tacticalSparks.filterInPlace(_.life > 0.0)
repeatFor(tacticalSparks)(_.update())
shockwaveRings.filterInPlace(_.active)
repeatFor(shockwaveRings)(_.update())
energyArcs.filterInPlace(_.life > 0.0)
repeatFor(energyArcs)(_.update())
orbitRings.filterInPlace(_.life > 0.0)
repeatFor(orbitRings)(_.update())
}
def spawnEnemyWave(): Unit = {
val spawnX = randomDouble(90.0, cwidth - 90.0)
val pattern = if (combatTimer < 30.0) random(2, 5) else random(1, 4)
val speed = -(0.75 + randomDouble(0.0, 0.55))
enemyDrones.append(new EnemyDrone(spawnX, cheight + 40.0, speed, pattern))
spawnParticleExplosion(spawnX, cheight - 10.0, 255, 50, 50, 8)
}
def startBossBattle(): Unit = {
flagshipBossActive = true
flagshipBossHP = flagshipBossMaxHP
bossShield = 100.0
bossPhase = 1
bossWarningTimer = 4.0
bossMovementPhase = 0.0
currentGameState = 3
redAlertAmount = 1.0
screenShakeMagnitude = 10.0
cinematicBars = 8.0
playTacticalTone(42, 220)
}
def processGameStateEngine(): Unit = {
universalClock += 0.025
globalElapsedTime += 0.025
radarRotationAngle += 0.08
radarPulse += 0.055
akashScanAngle += 0.04
pinakaPulse += 0.07
bossCorePulse += 0.09
tankEnginePulse += 0.08
ultimateExhaustPulse += 0.12
screenShakeMagnitude *= 0.86
globalColorFlash *= 0.84
redAlertAmount *= 0.95
whitePulse *= 0.95
dangerPulse *= 0.92
cinematicBars *= 0.97
tankRecoilAmount *= 0.85
tankHeat *= 0.99
missileLaunchFlash *= 0.90
if (mainGunCooldownTimer > 0) mainGunCooldownTimer -= 1
if (siloLaunchCooldownTimer > 0) siloLaunchCooldownTimer -= 1
if (cannonMuzzleFlashTimer > 0) cannonMuzzleFlashTimer -= 1
if (pinakaSalvoCooldown > 0) pinakaSalvoCooldown -= 1
updateParticleSystem()
if (currentGameState == 0) {
briefingDelta += 0.045
if (briefingDelta >= 0.03 && briefingIndex < briefingText.length) {
briefingIndex += 1
briefingDelta = 0.0
if (briefingIndex % 5 == 0) playTacticalTone(74, 10)
}
return
}
if (currentGameState == 1) {
commanderWalkPhase += 0.3
if (commandoPosX < defenseTankPosX - 35.0) {
commandoPosX += 3.5
} else {
commandoState = "BOARDED"
currentGameState = 2
playTacticalTone(78, 120)
}
return
}
if (currentGameState == 2) {
handleInteractiveControls()
combatTimer -= 0.033
refreshAllEntities()
evaluateCombatCollisions()
if (defenseTankPosX < 60.0) defenseTankPosX = 60.0
if (defenseTankPosX > cwidth - 60.0) defenseTankPosX = cwidth - 60.0
val spawnChance = if (combatTimer > 65.0) 0.035 else if (combatTimer > 35.0) 0.055 else 0.075
if (randomDouble(0.0, 1.0) < spawnChance) spawnEnemyWave()
if (pinakaSalvoCooldown <= 0 && enemyDrones.nonEmpty) {
val target = enemyDrones.head
val dx = target.posX - pinakaBatteryX
val dy = target.posY - pinakaBatteryY
val angle = math.atan2(dy, dx)
interceptorMissiles.append(new InterceptorMissile(pinakaBatteryX, pinakaBatteryY, 10.5, angle, 3))
pinakaSalvoCooldown = 38
spawnDirectionalParticles(pinakaBatteryX, pinakaBatteryY, angle, 255, 150, 50, 8)
}
if (randomDouble(0.0, 1.0) < 0.018) {
orbitRings.append(new OrbitRing(randomDouble(80.0, cwidth - 80.0), randomDouble(180.0, cheight - 90.0), randomDouble(45.0, 120.0), randomDouble(1.0, 3.0), randomDouble(0.0, 6.0)))
}
if (combatTimer <= 45.0 && !flagshipBossActive) {
startBossBattle()
return
}
if (combatTimer <= 0.0 && !flagshipBossActive) {
currentGameState = 4
ultimateStrikeX = defenseTankPosX + 250.0
ultimateStrikeY = cheight + 170.0
ultimateStrikeSpeed = 9.0
cinematicBars = 10.0
playTacticalTone(42, 220)
}
return
}
if (currentGameState == 3) {
handleInteractiveControls()
refreshAllEntities()
evaluateCombatCollisions()
bossWarningTimer -= 0.033
bossMovementPhase += 0.035
flagshipBossX = cwidth / 2.0 + math.sin(bossMovementPhase * 1.8) * 225.0
if (bossPhase == 1 && flagshipBossHP < 500.0) {
bossPhase = 2
redAlertAmount = 1.0
screenShakeMagnitude = 8.0
playTacticalTone(48, 150)
}
if (bossPhase == 2 && flagshipBossHP < 230.0) {
bossPhase = 3
redAlertAmount = 1.0
screenShakeMagnitude = 11.0
playTacticalTone(38, 180)
}
if (randomDouble(0.0, 1.0) < 0.28) {
spawnParticleExplosion(flagshipBossX + randomDouble(-55.0, 55.0), flagshipBossY + randomDouble(-35.0, 35.0), 255, 60, 40, 2)
}
if (bossPhase >= 2 && randomDouble(0.0, 1.0) < 0.03) {
val bx = flagshipBossX
val by = flagshipBossY
energyArcs.append(new EnergyArc(bx - 55.0, by, bx + 55.0, by + randomDouble(-30.0, 30.0)))
bossWeaponFlash = 1.0
}
if (flagshipBossHP <= 0.0) {
flagshipBossActive = false
currentGameState = 4
ultimateStrikeX = defenseTankPosX + 280.0
ultimateStrikeY = cheight + 170.0
ultimateStrikeSpeed = 8.5
cinematicBars = 12.0
triggerMegaExplosion(flagshipBossX, flagshipBossY)
playTacticalTone(36, 280)
}
return
}
if (currentGameState == 4) {
val dx = defenseTankPosX - ultimateStrikeX
val dy = (defenseTankPosY + 50.0) - ultimateStrikeY
val targetAngle = math.atan2(dy, dx)
ultimateStrikeAngle += (targetAngle - ultimateStrikeAngle) * 0.08
ultimateStrikeX += math.cos(ultimateStrikeAngle) * ultimateStrikeSpeed
ultimateStrikeY += math.sin(ultimateStrikeAngle) * ultimateStrikeSpeed
ultimateStrikeSpeed += 0.06
cinematicBars += 0.06
spawnDirectionalParticles(ultimateStrikeX - math.cos(ultimateStrikeAngle) * 30.0, ultimateStrikeY - math.sin(ultimateStrikeAngle) * 30.0, ultimateStrikeAngle + math.Pi, 255, 155, 50, 2)
if (math.abs(ultimateStrikeX - defenseTankPosX) < 30.0 && math.abs(ultimateStrikeY - (defenseTankPosY + 50.0)) < 30.0) {
triggerMegaExplosion(defenseTankPosX, defenseTankPosY + 50.0)
currentGameState = 5
whitePulse = 1.0
playTacticalTone(36, 300)
}
refreshAllEntities()
return
}
if (currentGameState == 5) {
refreshAllEntities()
return
}
}
def renderStarfieldBackground(c: CanvasDraw): Unit = {
for (i <- 0 until MAX_STARS_COUNT) {
val twinkle = math.abs(math.sin(universalClock * starTwinkleSpeeds(i) + i.toDouble))
val alphaVal = math.max(60, math.min(255, (70.0 + twinkle * 185.0).toInt))
var sy = starYCoords(i) - universalClock * (8.0 + starTwinkleSpeeds(i) * 4.0) * starDepth(i)
while (sy < 70.0) sy += cheight - 70.0
val drift = math.sin(universalClock * 0.2 + i.toDouble) * 1.5 * starDepth(i)
c.fill(225, 240, 255, alphaVal)
c.noStroke()
c.ellipse(starXCoords(i) + drift, sy, starSizes(i), starSizes(i))
}
}
def renderAtmosphericBackdrop(c: CanvasDraw): Unit = {
c.background(2, 5, 20)
renderStarfieldBackground(c)
c.fill(15, 50, 150, 26)
c.noStroke()
c.ellipse(200, cheight - 100, 450, 260)
c.fill(160, 20, 180, 20)
c.ellipse(cwidth - 180, 230, 380, 210)
c.fill(0, 140, 170, 12)
c.ellipse(cwidth / 2.0, 120.0, cwidth + 120.0, 180.0)
c.stroke(0, 100, 140, 45)
c.strokeWeight(1.0)
var gx = -50.0
while (gx < cwidth + 80.0) {
c.line(cwidth / 2.0, 80.0, gx, 0.0)
gx += 50.0
}
var gy = 80.0
while (gy < 260.0) {
c.line(0.0, gy, cwidth, gy)
gy += 25.0
}
}
def renderHorizonGlow(c: CanvasDraw): Unit = {
val pulse = 30.0 + math.abs(math.sin(universalClock * 1.8)) * 20.0
c.fill(255, 153, 51, 16)
c.noStroke()
c.ellipse(cwidth / 2.0, 65.0, cwidth + 100.0, pulse)
c.fill(255, 255, 255, 7)
c.ellipse(cwidth / 2.0, 73.0, cwidth, pulse * 0.65)
c.fill(18, 136, 7, 8)
c.ellipse(cwidth / 2.0, 80.0, cwidth - 60.0, pulse * 0.48)
}
def renderEmblemTricolorFlag(c: CanvasDraw): Unit = {
val fX = cwidth - 150.0
val fY = cheight - 175.0
c.stroke(245, 245, 245)
c.strokeWeight(5.0)
c.line(fX, fY - 130.0, fX, fY + 100.0)
var offset = 0.0
while (offset < 128.0) {
val wave = math.sin(universalClock * 4.5 + offset * 0.08) * 8.0
c.strokeWeight(3.5)
c.stroke(255, 153, 51)
c.line(fX + offset, fY + 52.0 + wave, fX + offset, fY + 75.0 + wave)
c.stroke(255, 255, 255)
c.line(fX + offset, fY + 29.0 + wave, fX + offset, fY + 52.0 + wave)
c.stroke(18, 136, 7)
c.line(fX + offset, fY + wave, fX + offset, fY + 29.0 + wave)
offset += 3.0
}
c.noFill()
c.stroke(0, 0, 200)
c.strokeWeight(2.5)
c.ellipse(fX + 64.0, fY + 39.0, 22.0, 22.0)
}
def renderBasePad(c: CanvasDraw): Unit = {
c.fill(25, 32, 38, 230)
c.stroke(70, 90, 95)
c.strokeWeight(2.0)
c.rect(20.0, 10.0, cwidth - 40.0, 42.0)
c.stroke(0, 180, 210, 90)
c.strokeWeight(1.0)
var x = 35.0
while (x < cwidth - 25.0) {
c.line(x, 14.0, x + 18.0, 48.0)
x += 32.0
}
}
def renderMainDefenseTank(c: CanvasDraw): Unit = {
c.fill(0, 0, 0, 120)
c.noStroke()
c.ellipse(defenseTankPosX, defenseTankPosY - 5.0, 175.0, 24.0)
c.fill(34, 39, 44)
c.stroke(12, 17, 22)
c.strokeWeight(1.5)
c.rect(defenseTankPosX - 70.0, defenseTankPosY, 140.0, 32.0)
c.fill(100, 105, 101)
for (i <- -5 to 5) {
c.ellipse(defenseTankPosX + i * 13.5, defenseTankPosY + 16.0, 11.0, 11.0)
}
c.fill(68, 110, 60)
c.rect(defenseTankPosX - 55.0, defenseTankPosY + 30.0, 110.0, 30.0)
c.fill(58, 96, 52)
c.ellipse(defenseTankPosX, defenseTankPosY + 59.0, 60.0, 34.0)
c.stroke(130, 150, 98)
c.strokeWeight(2.0)
c.ellipse(defenseTankPosX, defenseTankPosY + 59.0, 40.0, 22.0)
val barrelLen = 90.0 + tankRecoilAmount * 4.0
val tX = defenseTankPosX + math.cos(mainTurretAngle) * barrelLen
val tY = defenseTankPosY + 59.0 + math.sin(mainTurretAngle) * barrelLen
c.stroke(42, 72, 37)
c.strokeWeight(10.0 + tankRecoilAmount * 2.0)
c.line(defenseTankPosX, defenseTankPosY + 59.0, tX, tY)
c.stroke(120, 150, 95)
c.strokeWeight(2.0)
c.line(defenseTankPosX, defenseTankPosY + 61.0, tX, tY + 2.0)
val engineGlow = 90 + (math.abs(math.sin(tankEnginePulse)) * 120.0).toInt
c.fill(255, 80, 20, engineGlow)
c.noStroke()
c.ellipse(defenseTankPosX - 48.0, defenseTankPosY + 4.0, 9.0, 5.0)
c.ellipse(defenseTankPosX + 48.0, defenseTankPosY + 4.0, 9.0, 5.0)
if (cannonMuzzleFlashTimer > 0) {
val flashSize = 48.0 + cannonMuzzleFlashTimer * 3.0
c.fill(255, 150, 40, 210)
c.ellipse(tX, tY, flashSize, flashSize)
c.fill(255, 250, 180, 240)
c.ellipse(tX, tY, 22.0, 22.0)
}
}
def renderTankStatusLights(c: CanvasDraw): Unit = {
val baseX = defenseTankPosX - 35.0
val baseY = defenseTankPosY + 44.0
val pulse = math.abs(math.sin(universalClock * 6.0))
c.fill(0, 255, 180, 120 + (pulse * 100.0).toInt)
c.noStroke()
c.ellipse(baseX, baseY, 5.0, 5.0)
c.fill(255, 190, 40, 120 + (pulse * 100.0).toInt)
c.ellipse(baseX + 10.0, baseY, 5.0, 5.0)
c.fill(255, 70, 40, 120 + (pulse * 100.0).toInt)
c.ellipse(baseX + 20.0, baseY, 5.0, 5.0)
}
def renderStrategicSilo(c: CanvasDraw): Unit = {
c.fill(58, 63, 73)
c.stroke(25, 30, 38)
c.strokeWeight(2.0)
c.ellipse(siloXPos, siloYPos, 76.0, 76.0)
c.pushMatrix()
c.translate(siloXPos, siloYPos)
c.rotate(siloLauncherRotation)
c.fill(82, 108, 94)
c.rect(-18.0, -21.0, 80.0, 42.0)
c.fill(250, 50, 50)
c.noStroke()
c.rect(20.0, -21.0, 11.0, 42.0)
c.fill(140, 180, 160, 100)
c.rect(-9.0, -13.0, 42.0, 4.0)
c.popMatrix()
val pulse = 8.0 + math.abs(math.sin(universalClock * 5.0)) * 7.0
c.fill(0, 240, 255, 120)
c.noStroke()
c.ellipse(siloXPos, siloYPos, pulse, pulse)
}
def renderVegDefenseBatteries(c: CanvasDraw): Unit = {
c.fill(45, 85, 60)
c.stroke(20, 45, 30)
c.strokeWeight(2.0)
c.rect(akashBatteryX - 36.0, akashBatteryY - 16.0, 72.0, 32.0)
c.pushMatrix()
c.translate(akashBatteryX, akashBatteryY)
c.rotate(akashScanAngle)
c.stroke(0, 255, 180, 160)
c.strokeWeight(2.0)
c.line(0.0, 0.0, 24.0, 0.0)
c.popMatrix()
c.fill(0, 255, 180)
c.noStroke()
c.ellipse(akashBatteryX, akashBatteryY, 15.0, 15.0)
c.fill(255, 255, 255)
c.text("AKASH", akashBatteryX - 22.0, akashBatteryY - 24.0)
c.fill(85, 65, 43)
c.stroke(45, 30, 18)
c.strokeWeight(2.0)
c.rect(pinakaBatteryX - 42.0, pinakaBatteryY - 20.0, 84.0, 40.0)
val pulse = 70 + (math.abs(math.sin(pinakaPulse)) * 160.0).toInt
c.fill(255, 153, 51, pulse)
c.noStroke()
c.ellipse(pinakaBatteryX - 17.0, pinakaBatteryY, 9.0, 9.0)
c.ellipse(pinakaBatteryX, pinakaBatteryY, 9.0, 9.0)
c.ellipse(pinakaBatteryX + 17.0, pinakaBatteryY, 9.0, 9.0)
c.fill(255, 255, 255)
c.text("PINAKA", pinakaBatteryX - 26.0, pinakaBatteryY - 28.0)
}
def renderCommandoHero(c: CanvasDraw, x: Double, y: Double): Unit = {
if (commandoState == "BOARDED") return
val stride = math.sin(commanderWalkPhase) * 6.0
c.fill(0, 0, 0, 90)
c.noStroke()
c.ellipse(x, y - 5.0, 32.0, 11.0)
c.fill(240, 245, 252)
c.stroke(170, 180, 195)
c.strokeWeight(1.0)
c.rect(x - 9.0, y, 18.0, 28.0)
c.fill(0, 190, 255)
c.ellipse(x, y + 34.0, 24.0, 24.0)
c.stroke(240, 245, 252)
c.strokeWeight(5.0)
c.line(x - 3.0, y, x - 10.0 - stride, y - 15.0)
c.line(x + 3.0, y, x + 10.0 + stride, y - 15.0)
c.line(x - 10.0, y + 20.0, x - 18.0, y + 8.0)
c.line(x + 10.0, y + 20.0, x + 18.0, y + 8.0)
}
def renderRadar(c: CanvasDraw): Unit = {
val rx = 78.0
val ry = cheight - 122.0
c.fill(5, 22, 30, 220)
c.stroke(0, 255, 160, 210)
c.strokeWeight(2.0)
c.ellipse(rx, ry, 120.0, 120.0)
c.ellipse(rx, ry, 82.0, 82.0)
c.ellipse(rx, ry, 42.0, 42.0)
c.line(rx - 60.0, ry, rx + 60.0, ry)
c.line(rx, ry - 60.0, rx, ry + 60.0)
c.stroke(0, 255, 180, 235)
c.strokeWeight(2.5)
c.line(rx, ry, rx + math.cos(radarRotationAngle) * 57.0, ry + math.sin(radarRotationAngle) * 57.0)
repeatFor(enemyDrones) { drone =>
if (!drone.destroyed) {
val dx = math.max(-50.0, math.min(50.0, (drone.posX - cwidth / 2.0) / 5.0))
val dy = math.max(-50.0, math.min(50.0, (drone.posY - cheight / 2.0) / 5.0))
c.fill(255, 60, 60)
c.noStroke()
c.ellipse(rx + dx, ry + dy, 5.0, 5.0)
}
}
if (flagshipBossActive) {
c.fill(255, 220, 0)
c.ellipse(rx, ry + 45.0, 7.0, 7.0)
}
}
def renderTargetLock(c: CanvasDraw): Unit = {
if (enemyDrones.nonEmpty) {
val target = enemyDrones.head
if (!target.destroyed) {
val tx = target.posX
val ty = target.posY
val pulse = math.sin(universalClock * 8.0) * 4.0
c.noFill()
c.stroke(0, 255, 220, 220)
c.strokeWeight(2.0)
c.line(tx - 30.0 - pulse, ty - 25.0, tx - 10.0, ty - 25.0)
c.line(tx + 10.0, ty - 25.0, tx + 30.0 + pulse, ty - 25.0)
c.line(tx - 30.0, ty + 25.0, tx - 10.0, ty + 25.0)
c.line(tx + 10.0, ty + 25.0, tx + 30.0, ty + 25.0)
c.fill(0, 255, 220)
c.noStroke()
c.text("TARGET LOCK", tx - 38.0, ty + 42.0)
}
}
}
def renderFlagshipBoss(c: CanvasDraw): Unit = {
if (!flagshipBossActive) return
if (bossShield > 0.0) {
c.noFill()
c.stroke(0, 220, 255, 130)
c.strokeWeight(5.0)
c.ellipse(flagshipBossX, flagshipBossY, 160.0 + math.sin(bossCorePulse) * 10.0, 100.0 + math.sin(bossCorePulse) * 8.0)
}
c.fill(125, 20, 30)
c.stroke(255, 190, 50)
c.strokeWeight(3.0)
c.ellipse(flagshipBossX, flagshipBossY, 125.0, 64.0)
c.fill(62, 67, 80)
c.rect(flagshipBossX - 42.0, flagshipBossY - 40.0, 84.0, 24.0)
val corePulse = 22.0 + math.abs(math.sin(bossCorePulse)) * 5.0
c.fill(255, 55, 45, 120)
c.noStroke()
c.ellipse(flagshipBossX, flagshipBossY, corePulse + 12.0, corePulse + 12.0)
c.fill(255, 55, 45)
c.ellipse(flagshipBossX, flagshipBossY, corePulse, corePulse)
c.fill(42, 42, 48)
c.rect(flagshipBossX - 67.0, flagshipBossY - 12.0, 22.0, 24.0)
c.rect(flagshipBossX + 45.0, flagshipBossY - 12.0, 22.0, 24.0)
if (bossWeaponFlash > 0.1) {
c.fill(255, 180, 50, (bossWeaponFlash * 200.0).toInt)
c.ellipse(flagshipBossX, flagshipBossY - 45.0, 34.0, 34.0)
}
c.fill(20, 20, 28)
c.rect(flagshipBossX - 85.0, flagshipBossY + 58.0, 170.0, 10.0)
val bossRatio = math.max(0.0, math.min(1.0, flagshipBossHP / flagshipBossMaxHP))
c.fill(255, 50, 50)
c.rect(flagshipBossX - 85.0, flagshipBossY + 58.0, 170.0 * bossRatio, 10.0)
if (bossShield > 0.0) {
val shieldRatio = math.max(0.0, math.min(1.0, bossShield / 100.0))
c.fill(0, 210, 255)
c.rect(flagshipBossX - 85.0, flagshipBossY + 72.0, 170.0 * shieldRatio, 5.0)
}
c.fill(255, 220, 80)
c.text(s"PHASE $bossPhase", flagshipBossX - 35.0, flagshipBossY + 93.0)
}
def renderBossWarning(c: CanvasDraw): Unit = {
if (currentGameState == 3 && bossWarningTimer > 0.0) {
val pulse = math.abs(math.sin(universalClock * 7.0))
c.fill(255, 0, 0, (70.0 + pulse * 140.0).toInt)
c.noStroke()
c.rect(0.0, 0.0, cwidth, 34.0)
c.fill(255, 255, 255)
c.text("WARNING // HOSTILE FLAGSHIP DETECTED", cwidth / 2.0 - 150.0, 23.0)
}
}
def renderBossAura(c: CanvasDraw): Unit = {
if (!flagshipBossActive) return
val pulse = 20.0 + math.abs(math.sin(universalClock * 2.0)) * 30.0
c.fill(255, 40, 30, 12)
c.noStroke()
c.ellipse(flagshipBossX, flagshipBossY, 300.0 + pulse, 180.0 + pulse * 0.5)
}
def renderTacticalGridHighlights(c: CanvasDraw): Unit = {
c.noFill()
c.stroke(0, 170, 200, 45)
c.strokeWeight(1.0)
var x = 30.0
while (x < cwidth - 20.0) {
c.rect(x, 58.0, 40.0, 18.0)
x += 50.0
}
}
def renderHUDStatusOverlay(c: CanvasDraw): Unit = {
c.fill(5, 10, 30, 245)
c.stroke(0, 255, 255, 190)
c.strokeWeight(2.0)
c.rect(15.0, cheight - 66.0, cwidth - 30.0, 50.0)
c.fill(255, 220, 70)
c.text("OPERATION SINDOOR V11.0", 28.0, cheight - 38.0)
c.fill(110, 255, 225)
c.text(s"TARGETS: $scoreDestroyedCount / $quotaRequirement", 235.0, cheight - 38.0)
c.fill(255, 120, 110)
c.text(s"TIME: ${combatTimer.toInt}s", 410.0, cheight - 38.0)
c.fill(30, 35, 48)
c.rect(525.0, cheight - 53.0, 150.0, 10.0)
c.fill(40, 220, 110)
c.rect(525.0, cheight - 53.0, 150.0 * math.max(0.0, math.min(1.0, commanderHP / 100.0)), 10.0)
c.fill(255, 255, 255)
c.text("COMMANDER", 560.0, cheight - 25.0)
renderRadar(c)
}
def renderTacticalControlPanel(c: CanvasDraw): Unit = {
c.fill(14, 20, 45, 255)
c.stroke(0, 255, 255)
c.strokeWeight(1.8)
c.rect(15.0, 88.0, 710.0, 52.0)
c.fill(70, 75, 110)
c.rect(20.0, 96.0, 52.0, 32.0)
c.rect(78.0, 96.0, 52.0, 32.0)
c.fill(255, 255, 255)
c.text("T-", 38.0, 116.0)
c.text("T+", 96.0, 116.0)
c.fill(100, 50, 50)
c.rect(136.0, 96.0, 52.0, 32.0)
c.rect(194.0, 96.0, 52.0, 32.0)
c.fill(255, 255, 255)
c.text("C-", 154.0, 116.0)
c.text("C+", 212.0, 116.0)
c.fill(240, 100, 0)
c.rect(252.0, 96.0, 62.0, 32.0)
c.fill(255, 255, 255)
c.text("FIRE", 267.0, 116.0)
c.fill(50, 120, 120)
c.rect(320.0, 96.0, 48.0, 32.0)
c.rect(374.0, 96.0, 48.0, 32.0)
c.fill(255, 255, 255)
c.text("M-", 334.0, 116.0)
c.text("M+", 388.0, 116.0)
c.fill(if (activeMissileTypeScript == 1) 240 else 80, 35, 150)
c.rect(426.0, 96.0, 48.0, 32.0)
c.fill(if (activeMissileTypeScript == 2) 240 else 80, 35, 150)
c.rect(480.0, 96.0, 48.0, 32.0)
c.fill(if (activeMissileTypeScript == 3) 240 else 80, 35, 150)
c.rect(534.0, 96.0, 48.0, 32.0)
c.fill(255, 255, 255)
c.text("A", 444.0, 116.0)
c.text("B", 498.0, 116.0)
c.text("C", 552.0, 116.0)
c.fill(200, 0, 240)
c.rect(592.0, 96.0, 120.0, 32.0)
c.fill(255, 255, 255)
c.text("HYPER LAUNCH", 602.0, 116.0)
}
def renderTopBars(c: CanvasDraw): Unit = {
c.fill(3, 8, 25, 180)
c.noStroke()
c.rect(0.0, cheight - 14.0, cwidth, 14.0)
val ratio = math.max(0.0, math.min(1.0, combatTimer / 100.0))
c.fill(255, 153, 51)
c.rect(0.0, cheight - 14.0, cwidth * ratio, 14.0)
c.fill(255, 255, 255)
c.text("COMMAND LINK ONLINE", 20.0, cheight - 4.0)
if (flagshipBossActive) {
c.fill(255, 60, 60)
c.text("FLAGSHIP THREAT ACTIVE", cwidth - 155.0, cheight - 4.0)
}
}
def renderTacticalBriefingTerminal(c: CanvasDraw): Unit = {
c.background(1, 4, 16)
renderStarfieldBackground(c)
renderHorizonGlow(c)
val tX = cwidth / 2.0 - 315.0
val tY = cheight / 2.0 - 190.0
c.fill(0, 80, 140, 28)
c.noStroke()
c.ellipse(cwidth / 2.0, cheight / 2.0, 720.0, 480.0)
c.fill(8, 16, 40, 255)
c.stroke(0, 255, 255)
c.strokeWeight(3.0)
c.rect(tX, tY, 630.0, 400.0)
c.fill(255, 220, 70)
c.text("OPERATION SINDOOR - COMMAND TERMINAL", tX + 30.0, tY + 32.0)
c.fill(90, 255, 225)
c.text(ENGINE_VERSION, tX + 420.0, tY + 32.0)
val partialText = briefingText.substring(0, briefingIndex)
val lines = partialText.split("\n")
var cursorY = tY + 66.0
for (line <- lines) {
c.fill(235, 245, 255)
c.text(line, tX + 25.0, cursorY)
cursorY += 19.0
}
c.fill(0, 230, 150, 50)
c.noStroke()
c.rect(tX + 20.0, tY + 54.0, 590.0, 1.0)
if (briefingIndex >= briefingText.length) {
val bx = tX + 165.0
val by = tY - 60.0
val pulse = 0.85 + math.sin(universalClock * 4.0) * 0.15
c.fill(0, 230, 150, (255.0 * pulse).toInt)
c.stroke(255, 255, 255)
c.strokeWeight(2.5)
c.rect(bx, by, 300.0, 44.0)
c.fill(255, 255, 255)
c.text("INITIALIZE HYPER DEFENSE", bx + 22.0, by + 28.0)
if (isMousePressed && mouseX >= bx && mouseX <= bx + 300.0 && mouseY >= by && mouseY <= by + 44.0) {
currentGameState = 1
playTacticalTone(80, 140)
}
}
}
def renderCommanderArrivalFX(c: CanvasDraw): Unit = {
if (currentGameState != 1) return
c.stroke(0, 255, 255, 70)
c.strokeWeight(1.0)
var y = 180.0
while (y < cheight - 80.0) {
c.line(0.0, y, cwidth, y)
y += 36.0
}
val pulse = 20.0 + math.abs(math.sin(universalClock * 2.0)) * 25.0
c.noFill()
c.stroke(0, 220, 255, 110)
c.ellipse(commandoPosX, commandoPosY + 18.0, 40.0 + pulse, 20.0)
}
def renderTargetVector(c: CanvasDraw): Unit = {
if (enemyDrones.nonEmpty && currentGameState == 2) {
val target = enemyDrones.head
if (!target.destroyed) {
c.stroke(0, 255, 220, 55)
c.strokeWeight(1.0)
c.line(defenseTankPosX, defenseTankPosY + 60.0, target.posX, target.posY)
}
}
}
def renderUltimateStrike(c: CanvasDraw): Unit = {
if (currentGameState != 4) return
c.pushMatrix()
c.translate(ultimateStrikeX, ultimateStrikeY)
c.rotate(ultimateStrikeAngle)
val glow = 65.0 + math.abs(math.sin(ultimateExhaustPulse)) * 25.0
c.fill(255, 80, 20, 55)
c.noStroke()
c.ellipse(-22.0, 0.0, glow, glow * 0.45)
c.fill(245, 245, 245)
c.stroke(150, 30, 30)
c.strokeWeight(2.0)
c.rect(-38.0, -12.0, 76.0, 24.0)
c.fill(255, 235, 100)
c.noStroke()
c.ellipse(40.0, 0.0, 28.0, 28.0)
c.fill(255, 80, 20)
c.ellipse(-40.0, 0.0, 18.0, 18.0)
c.fill(255, 190, 50, 100)
c.ellipse(-50.0, 0.0, 35.0, 35.0)
c.popMatrix()
}
def renderTricolorBeacon(c: CanvasDraw): Unit = {
val bx = cwidth / 2.0
val by = 72.0
c.fill(255, 153, 51, 12)
c.noStroke()
c.ellipse(bx, by, 450.0, 100.0)
c.fill(255, 255, 255, 8)
c.ellipse(bx, by, 380.0, 82.0)
c.fill(18, 136, 7, 8)
c.ellipse(bx, by, 320.0, 64.0)
}
def renderShieldDome(c: CanvasDraw): Unit = {
if (currentGameState != 2 && currentGameState != 3) return
val pulse = 0.5 + math.abs(math.sin(universalClock * 1.4)) * 0.5
c.noFill()
c.stroke(0, 255, 210, (25.0 + pulse * 45.0).toInt)
c.strokeWeight(2.0)
c.ellipse(cwidth / 2.0, 125.0, cwidth - 90.0, 160.0)
c.stroke(0, 180, 255, (15.0 + pulse * 30.0).toInt)
c.ellipse(cwidth / 2.0, 125.0, cwidth - 180.0, 118.0)
}
def renderCinematicBars(c: CanvasDraw): Unit = {
val amount = math.max(0, math.min(55, cinematicBars.toInt))
if (amount > 0) {
c.fill(0, 0, 0)
c.noStroke()
c.rect(0.0, 0.0, cwidth, amount)
c.rect(0.0, cheight - amount, cwidth, amount)
}
}
def renderGlobalFlash(c: CanvasDraw): Unit = {
if (globalColorFlash > 0.01) {
c.fill(255, 245, 210, math.max(0, math.min(255, (globalColorFlash * 255.0).toInt)))
c.noStroke()
c.rect(0.0, 0.0, cwidth, cheight)
}
}
def renderRedAlert(c: CanvasDraw): Unit = {
if (redAlertAmount > 0.02) {
val a = math.max(0, math.min(200, (redAlertAmount * 200.0).toInt))
c.noFill()
c.stroke(255, 20, 20, a)
c.strokeWeight(7.0)
c.rect(4.0, 4.0, cwidth - 8.0, cheight - 8.0)
}
}
def renderDigitalLabels(c: CanvasDraw): Unit = {
if (currentGameState == 2 || currentGameState == 3) {
c.fill(100, 255, 230, 180)
c.text("SECURE NET", 25.0, 72.0)
c.text("LINK: OK", 25.0, 55.0)
c.fill(255, 220, 80, 180)
c.text("SECTOR 07", cwidth - 90.0, 72.0)
c.fill(255, 120, 90, 180)
c.text("LIVE", cwidth - 55.0, 55.0)
}
}
def renderUltimateTributeScreen(c: CanvasDraw): Unit = {
c.background(0, 0, 0)
for (i <- 0 until 170) {
val px = math.abs(math.sin(universalClock * 0.4 + i.toDouble)) * (cwidth - 1.0)
val py = 40.0 + math.abs(math.sin(i.toDouble * 1.6)) * (cheight - 80.0)
c.fill(255, 255, 255, 185)
c.noStroke()
c.ellipse(px, py, 2.5, 2.5)
}
val pulse = 1.0 + math.abs(math.sin(universalClock * 1.5)) * 0.15
c.fill(255, 153, 51)
c.rect(cwidth / 2.0 - 220.0, 70.0, 440.0, 5.0)
c.fill(255, 255, 255)
c.rect(cwidth / 2.0 - 220.0, 61.0, 440.0, 5.0)
c.fill(18, 136, 7)
c.rect(cwidth / 2.0 - 220.0, 52.0, 440.0, 5.0)
c.fill(255, 220, 100, (230.0 * pulse).toInt)
c.text("JAI HIND", cwidth / 2.0 - 42.0, cheight / 2.0 + 95.0)
c.fill(255, 255, 255)
c.text("MISSION ACCOMPLISHED", cwidth / 2.0 - 130.0, cheight / 2.0 + 35.0)
c.fill(255, 235, 190)
c.text("SALUTE TO OUR BRAVE DEFENDERS", cwidth / 2.0 - 145.0, cheight / 2.0 - 5.0)
c.fill(130, 245, 255)
c.text("QUANTUM SHIELD STATUS: STABLE", cwidth / 2.0 - 130.0, cheight / 2.0 - 45.0)
c.fill(255, 255, 255)
c.text("ULTIMATE VALOR ? ABSOLUTE HONOR", cwidth / 2.0 - 135.0, cheight / 2.0 - 85.0)
c.fill(160, 220, 255, 160)
c.text(s"DEFENSE SCORE: $scoreDestroyedCount", cwidth / 2.0 - 80.0, cheight / 2.0 - 125.0)
}
def renderGamePipeline(c: CanvasDraw): Unit = {
if (currentGameState == 0) {
renderTacticalBriefingTerminal(c)
return
}
if (currentGameState == 1) {
renderAtmosphericBackdrop(c)
renderHorizonGlow(c)
renderTricolorBeacon(c)
renderCommanderArrivalFX(c)
renderEmblemTricolorFlag(c)
renderStrategicSilo(c)
renderMainDefenseTank(c)
renderTankStatusLights(c)
renderVegDefenseBatteries(c)
renderCommandoHero(c, commandoPosX, commandoPosY)
renderBasePad(c)
c.fill(255, 220, 90)
c.text("COMMANDER DEPLOYMENT IN PROGRESS...", cwidth / 2.0 - 150.0, cheight - 35.0)
renderCinematicBars(c)
return
}
if (currentGameState == 5) {
renderUltimateTributeScreen(c)
return
}
renderAtmosphericBackdrop(c)
renderHorizonGlow(c)
renderTricolorBeacon(c)
renderShieldDome(c)
renderTacticalGridHighlights(c)
if (screenShakeMagnitude > 0.5) {
c.pushMatrix()
cameraDriftX = randomDouble(-screenShakeMagnitude, screenShakeMagnitude)
cameraDriftY = randomDouble(-screenShakeMagnitude, screenShakeMagnitude)
c.translate(cameraDriftX, cameraDriftY)
}
renderBossAura(c)
renderEmblemTricolorFlag(c)
renderStrategicSilo(c)
renderMainDefenseTank(c)
renderTankStatusLights(c)
renderVegDefenseBatteries(c)
renderFlagshipBoss(c)
renderBasePad(c)
renderTargetVector(c)
renderParticleSystem(c)
repeatFor(orbitRings)(_.render(c))
repeatFor(tankShells)(_.render(c))
repeatFor(interceptorMissiles)(_.render(c))
repeatFor(enemyDrones)(_.render(c))
repeatFor(tacticalSparks)(_.render(c))
repeatFor(shockwaveRings)(_.render(c))
repeatFor(energyArcs)(_.render(c))
renderTargetLock(c)
renderUltimateStrike(c)
if (currentGameState == 2 || currentGameState == 3) {
renderTacticalControlPanel(c)
renderHUDStatusOverlay(c)
renderTopBars(c)
renderDigitalLabels(c)
renderBossWarning(c)
}
if (currentGameState == 4) {
c.fill(255, 120, 80)
c.text("ULTIMATE HYPER STRIKE // FINAL SEQUENCE", cwidth / 2.0 - 145.0, cheight - 40.0)
}
if (screenShakeMagnitude > 0.5) {
c.popMatrix()
}
renderGlobalFlash(c)
renderRedAlert(c)
renderCinematicBars(c)
}
def renderHalo01(c: CanvasDraw, x: Double, y: Double, s: Double): Unit = {
c.noFill()
c.stroke(0, 255, 255, 55)
c.strokeWeight(1.0)
c.ellipse(x, y, s + math.sin(universalClock * 2.0) * 5.0, s * 0.35)
}
def renderHalo02(c: CanvasDraw, x: Double, y: Double, s: Double): Unit = {
c.noFill()
c.stroke(255, 153, 51, 50)
c.strokeWeight(1.0)
c.ellipse(x, y, s * 0.7, s + math.cos(universalClock * 2.0) * 6.0)
}
def renderHalo03(c: CanvasDraw, x: Double, y: Double, s: Double): Unit = {
c.noFill()
c.stroke(18, 136, 7, 45)
c.strokeWeight(1.0)
c.ellipse(x, y, s, s * 0.25)
}
def renderScanLine01(c: CanvasDraw, y: Double): Unit = {
c.stroke(0, 220, 255, 35)
c.strokeWeight(1.0)
c.line(0.0, y, cwidth, y)
}
def renderScanLine02(c: CanvasDraw, y: Double): Unit = {
c.stroke(0, 160, 255, 24)
c.strokeWeight(1.0)
c.line(0.0, y, cwidth, y)
}
def renderScanLine03(c: CanvasDraw, y: Double): Unit = {
c.stroke(255, 153, 51, 20)
c.strokeWeight(1.0)
c.line(0.0, y, cwidth, y)
}
def renderEnergyPoint01(c: CanvasDraw, x: Double, y: Double): Unit = {
val a = 80 + (math.abs(math.sin(universalClock * 3.0)) * 150.0).toInt
c.fill(0, 255, 255, a)
c.noStroke()
c.ellipse(x, y, 5.0, 5.0)
}
def renderEnergyPoint02(c: CanvasDraw, x: Double, y: Double): Unit = {
val a = 70 + (math.abs(math.cos(universalClock * 2.5)) * 170.0).toInt
c.fill(255, 180, 50, a)
c.noStroke()
c.ellipse(x, y, 6.0, 6.0)
}
def renderEnergyPoint03(c: CanvasDraw, x: Double, y: Double): Unit = {
val a = 70 + (math.abs(math.sin(universalClock * 1.8)) * 150.0).toInt
c.fill(18, 136, 7, a)
c.noStroke()
c.ellipse(x, y, 4.0, 4.0)
}
def renderDecorRing01(c: CanvasDraw): Unit = {
renderHalo01(c, akashBatteryX, akashBatteryY, 70.0)
}
def renderDecorRing02(c: CanvasDraw): Unit = {
renderHalo02(c, pinakaBatteryX, pinakaBatteryY, 82.0)
}
def renderDecorRing03(c: CanvasDraw): Unit = {
renderHalo03(c, siloXPos, siloYPos, 90.0)
}
def renderTacticalDots01(c: CanvasDraw): Unit = {
renderEnergyPoint01(c, akashBatteryX + 28.0, akashBatteryY + 20.0)
renderEnergyPoint01(c, akashBatteryX - 28.0, akashBatteryY - 20.0)
}
def renderTacticalDots02(c: CanvasDraw): Unit = {
renderEnergyPoint02(c, pinakaBatteryX + 35.0, pinakaBatteryY + 17.0)
renderEnergyPoint02(c, pinakaBatteryX - 35.0, pinakaBatteryY - 17.0)
}
def renderTacticalDots03(c: CanvasDraw): Unit = {
renderEnergyPoint03(c, siloXPos + 35.0, siloYPos + 20.0)
renderEnergyPoint03(c, siloXPos - 35.0, siloYPos - 20.0)
}
def renderCross01(c: CanvasDraw, x: Double, y: Double, size: Double): Unit = {
val p = math.abs(math.sin(universalClock * 2.0))
c.stroke(0, 255, 255, (50.0 + p * 100.0).toInt)
c.strokeWeight(1.0)
c.line(x - size, y, x + size, y)
c.line(x, y - size, x, y + size)
}
def renderCross02(c: CanvasDraw, x: Double, y: Double, size: Double): Unit = {
val p = math.abs(math.cos(universalClock * 2.0))
c.stroke(255, 153, 51, (40.0 + p * 100.0).toInt)
c.strokeWeight(1.0)
c.line(x - size, y, x + size, y)
c.line(x, y - size, x, y + size)
}
def renderCross03(c: CanvasDraw, x: Double, y: Double, size: Double): Unit = {
val p = math.abs(math.sin(universalClock * 3.0))
c.stroke(18, 136, 7, (40.0 + p * 100.0).toInt)
c.strokeWeight(1.0)
c.line(x - size, y, x + size, y)
c.line(x, y - size, x, y + size)
}
def renderMissileLane01(c: CanvasDraw, x: Double): Unit = {
c.stroke(0, 220, 255, 20)
c.line(x, 120.0, x, cheight - 80.0)
}
def renderMissileLane02(c: CanvasDraw, x: Double): Unit = {
c.stroke(255, 150, 40, 18)
c.line(x, 120.0, x, cheight - 80.0)
}
def renderMissileLane03(c: CanvasDraw, x: Double): Unit = {
c.stroke(18, 136, 7, 18)
c.line(x, 120.0, x, cheight - 80.0)
}
def renderSectorPulse01(c: CanvasDraw): Unit = {
val p = 50.0 + math.abs(math.sin(universalClock * 0.9)) * 50.0
c.noFill()
c.stroke(0, 255, 255, (p).toInt)
c.ellipse(cwidth / 2.0, 165.0, 340.0, 110.0)
}
def renderSectorPulse02(c: CanvasDraw): Unit = {
val p = 40.0 + math.abs(math.cos(universalClock * 1.1)) * 50.0
c.noFill()
c.stroke(255, 153, 51, (p).toInt)
c.ellipse(cwidth / 2.0, 165.0, 430.0, 140.0)
}
def renderSectorPulse03(c: CanvasDraw): Unit = {
val p = 30.0 + math.abs(math.sin(universalClock * 1.3)) * 40.0
c.noFill()
c.stroke(18, 136, 7, (p).toInt)
c.ellipse(cwidth / 2.0, 165.0, 520.0, 170.0)
}
def renderNode01(c: CanvasDraw, x: Double, y: Double): Unit = {
val py = y + math.sin(universalClock * 1.3 + x) * 7.0
renderEnergyPoint01(c, x, py)
}
def renderNode02(c: CanvasDraw, x: Double, y: Double): Unit = {
val py = y + math.cos(universalClock * 1.1 + x) * 7.0
renderEnergyPoint02(c, x, py)
}
def renderNode03(c: CanvasDraw, x: Double, y: Double): Unit = {
val py = y + math.sin(universalClock * 1.7 + x) * 6.0
renderEnergyPoint03(c, x, py)
}
def renderCornerMarker01(c: CanvasDraw, x: Double, y: Double): Unit = {
c.stroke(0, 255, 255, 80)
c.strokeWeight(2.0)
c.line(x, y, x + 18.0, y)
c.line(x, y, x, y + 18.0)
}
def renderCornerMarker02(c: CanvasDraw, x: Double, y: Double): Unit = {
c.stroke(255, 153, 51, 65)
c.strokeWeight(2.0)
c.line(x, y, x - 18.0, y)
c.line(x, y, x, y + 18.0)
}
def renderCornerMarker03(c: CanvasDraw, x: Double, y: Double): Unit = {
c.stroke(18, 136, 7, 65)
c.strokeWeight(2.0)
c.line(x, y, x + 18.0, y)
c.line(x, y, x, y - 18.0)
}
def renderCornerMarker04(c: CanvasDraw, x: Double, y: Double): Unit = {
c.stroke(255, 60, 60, 65)
c.strokeWeight(2.0)
c.line(x, y, x - 18.0, y)
c.line(x, y, x, y - 18.0)
}
def renderBeacon01(c: CanvasDraw, x: Double, y: Double): Unit = {
val p = 4.0 + math.abs(math.sin(universalClock * 4.0)) * 4.0
c.fill(0, 255, 255, 150)
c.noStroke()
c.ellipse(x, y, p, p)
}
def renderBeacon02(c: CanvasDraw, x: Double, y: Double): Unit = {
val p = 4.0 + math.abs(math.cos(universalClock * 4.0)) * 4.0
c.fill(255, 160, 40, 150)
c.noStroke()
c.ellipse(x, y, p, p)
}
def renderBeacon03(c: CanvasDraw, x: Double, y: Double): Unit = {
val p = 4.0 + math.abs(math.sin(universalClock * 5.0)) * 4.0
c.fill(18, 136, 7, 150)
c.noStroke()
c.ellipse(x, y, p, p)
}
def renderHUDPulse01(c: CanvasDraw): Unit = {
val y = cheight - 71.0 + math.sin(universalClock * 3.0) * 3.0
c.stroke(0, 255, 255, 50)
c.strokeWeight(1.0)
c.line(20.0, y, cwidth - 20.0, y)
}
def renderHUDPulse02(c: CanvasDraw): Unit = {
val y = cheight - 78.0 + math.cos(universalClock * 2.8) * 3.0
c.stroke(255, 153, 51, 35)
c.strokeWeight(1.0)
c.line(30.0, y, cwidth - 30.0, y)
}
def renderPointer01(c: CanvasDraw, x: Double, y: Double, a: Double): Unit = {
c.stroke(0, 255, 220, 90)
c.strokeWeight(1.0)
c.line(x, y, x + math.cos(a) * 32.0, y + math.sin(a) * 32.0)
}
def renderPointer02(c: CanvasDraw, x: Double, y: Double, a: Double): Unit = {
c.stroke(255, 170, 50, 80)
c.strokeWeight(1.0)
c.line(x, y, x + math.cos(a) * 25.0, y + math.sin(a) * 25.0)
}
def renderPointer03(c: CanvasDraw, x: Double, y: Double, a: Double): Unit = {
c.stroke(18, 136, 7, 80)
c.strokeWeight(1.0)
c.line(x, y, x + math.cos(a) * 20.0, y + math.sin(a) * 20.0)
}
def renderBossPhaseLines(c: CanvasDraw): Unit = {
if (!flagshipBossActive) return
val p = 50 + (math.abs(math.sin(universalClock * 4.0)) * 80.0).toInt
c.stroke(255, 60, 60, p)
c.strokeWeight(1.0)
c.line(flagshipBossX - 100.0, flagshipBossY, flagshipBossX - 130.0, flagshipBossY)
c.line(flagshipBossX + 100.0, flagshipBossY, flagshipBossX + 130.0, flagshipBossY)
}
def renderBossPhaseLines02(c: CanvasDraw): Unit = {
if (!flagshipBossActive) return
val p = 40 + (math.abs(math.cos(universalClock * 3.5)) * 80.0).toInt
c.stroke(0, 220, 255, p)
c.strokeWeight(1.0)
c.line(flagshipBossX, flagshipBossY - 80.0, flagshipBossX, flagshipBossY - 115.0)
c.line(flagshipBossX, flagshipBossY + 80.0, flagshipBossX, flagshipBossY + 115.0)
}
def renderBossPhaseLines03(c: CanvasDraw): Unit = {
if (!flagshipBossActive) return
val p = 25 + (math.abs(math.sin(universalClock * 2.9)) * 70.0).toInt
c.stroke(255, 190, 40, p)
c.strokeWeight(1.0)
c.line(flagshipBossX - 120.0, flagshipBossY - 50.0, flagshipBossX - 150.0, flagshipBossY - 70.0)
c.line(flagshipBossX + 120.0, flagshipBossY - 50.0, flagshipBossX + 150.0, flagshipBossY - 70.0)
}
def renderFinalStrikeWarning(c: CanvasDraw): Unit = {
if (currentGameState == 4) {
val pulse = math.abs(math.sin(universalClock * 6.0))
c.fill(255, 80, 30, (40.0 + pulse * 80.0).toInt)
c.noStroke()
c.rect(20.0, 155.0, cwidth - 40.0, 2.0)
}
}
def renderFinalStrikeWarning02(c: CanvasDraw): Unit = {
if (currentGameState == 4) {
val pulse = math.abs(math.cos(universalClock * 5.0))
c.stroke(255, 180, 70, (35.0 + pulse * 80.0).toInt)
c.strokeWeight(1.0)
c.line(20.0, 150.0, cwidth - 20.0, 150.0)
}
}
def renderFinalStrikeVector(c: CanvasDraw): Unit = {
if (currentGameState == 4) {
c.stroke(255, 150, 60, 45)
c.strokeWeight(1.0)
c.line(ultimateStrikeX, ultimateStrikeY, defenseTankPosX, defenseTankPosY + 50.0)
}
}
def renderCommanderSignal(c: CanvasDraw): Unit = {
if (currentGameState == 1) {
val p = 12.0 + math.abs(math.sin(universalClock * 4.0)) * 8.0
c.noFill()
c.stroke(0, 255, 255, 100)
c.strokeWeight(1.0)
c.ellipse(commandoPosX, commandoPosY + 34.0, p + 20.0, p + 20.0)
}
}
def renderCommanderSignal02(c: CanvasDraw): Unit = {
if (currentGameState == 1) {
val p = 8.0 + math.abs(math.cos(universalClock * 3.0)) * 5.0
c.fill(255, 255, 255, 45)
c.noStroke()
c.ellipse(commandoPosX, commandoPosY + 34.0, p, p)
}
}
def renderShieldNodes(c: CanvasDraw): Unit = {
if (currentGameState == 2 || currentGameState == 3) {
val cx = cwidth / 2.0
val cy = 125.0
renderBeacon01(c, cx - 180.0, cy + 20.0)
renderBeacon01(c, cx, cy + 40.0)
renderBeacon01(c, cx + 180.0, cy + 20.0)
renderBeacon01(c, cx - 90.0, cy - 5.0)
renderBeacon01(c, cx + 90.0, cy - 5.0)
}
}
def renderMovingGridPoint01(c: CanvasDraw): Unit = {
val x = 40.0 + math.abs(math.sin(universalClock * 0.8)) * (cwidth - 80.0)
renderEnergyPoint01(c, x, 205.0)
}
def renderMovingGridPoint02(c: CanvasDraw): Unit = {
val x = 40.0 + math.abs(math.cos(universalClock * 0.65)) * (cwidth - 80.0)
renderEnergyPoint02(c, x, 232.0)
}
def renderAdvancedOverlay(c: CanvasDraw): Unit = {
if (currentGameState != 0 && currentGameState != 5) {
renderDecorRing01(c)
renderDecorRing02(c)
renderDecorRing03(c)
renderTacticalDots01(c)
renderTacticalDots02(c)
renderTacticalDots03(c)
renderCross01(c, akashBatteryX, akashBatteryY, 14.0)
renderCross02(c, pinakaBatteryX, pinakaBatteryY, 14.0)
renderCross03(c, siloXPos, siloYPos, 14.0)
renderMissileLane01(c, siloXPos - 50.0)
renderMissileLane02(c, siloXPos)
renderMissileLane03(c, siloXPos + 50.0)
renderSectorPulse01(c)
renderSectorPulse02(c)
renderSectorPulse03(c)
renderNode01(c, 120.0, 260.0)
renderNode02(c, cwidth - 150.0, 290.0)
renderNode03(c, cwidth / 2.0, 320.0)
renderCornerMarker01(c, 25.0, cheight - 85.0)
renderCornerMarker02(c, cwidth - 25.0, cheight - 85.0)
renderCornerMarker03(c, 25.0, 150.0)
renderCornerMarker04(c, cwidth - 25.0, 150.0)
renderPointer01(c, akashBatteryX, akashBatteryY, akashScanAngle)
renderPointer02(c, pinakaBatteryX, pinakaBatteryY, pinakaPulse)
renderPointer03(c, siloXPos, siloYPos, siloLauncherRotation)
renderBossPhaseLines(c)
renderBossPhaseLines02(c)
renderBossPhaseLines03(c)
renderFinalStrikeWarning(c)
renderFinalStrikeWarning02(c)
renderFinalStrikeVector(c)
renderCommanderSignal(c)
renderCommanderSignal02(c)
renderShieldNodes(c)
renderMovingGridPoint01(c)
renderMovingGridPoint02(c)
renderHUDPulse01(c)
renderHUDPulse02(c)
renderBeacon02(c, pinakaBatteryX, pinakaBatteryY)
renderBeacon03(c, akashBatteryX, akashBatteryY)
}
}
def renderFrame(c: CanvasDraw): Unit = {
renderGamePipeline(c)
renderAdvancedOverlay(c)
}
animateWithCanvasDraw { c =>
processGameStateEngine()
renderFrame(c)
}