User prompt
Add 99 more super really annoying and super annoying and really funny bugs. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make super annoying noises going off every 0000.000.001 seconds
User prompt
Make a flash that hurts the player’s eyes ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Add a SUPER funny jumpscare every 30 seconds
User prompt
Make random ads advertising to go to McDonald’s to go to Walmart and to eat a banana.
User prompt
Make it less laggy and make it flash colors and and the screen spins so fast for 4 seconds and add 5 more ridiculously funny bugs. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Add a SUPER SUPER SUPER FUNNY JUMPSCARE AND ADD 32 more Hilarious super funny super Duper snooper so funny super Duper funny, super Duper funny, funny, unbelievably funny bugs
User prompt
Make it where the game can’t lag and if it does it keeps going and it doesn’t lag
User prompt
Make it where the player can’t die
User prompt
Add 21 more super super super super super super Duper super super hilarious super super snooper ∞ Amount funny super funny bugs.
User prompt
Fix the bug Compilation error[L1135]: Timeout.tick error: null is not an object (evaluating 'player.canShoot = true')
User prompt
Please fix the bug: 'Timeout.tick error: null is not an object (evaluating 'player.canShoot = true')' in or related to this line: 'player.canShoot = true;' Line Number: 1135
User prompt
Add 21 more super super super super super super Duper super super hilarious super super snooper ∞ Amount funny super funny bugs.
User prompt
Add 12 more hilarious super funny bugs
User prompt
Remove the thing where if you shoot the asteroid you don’t win
User prompt
Add 5 more bugs and remove the bug where enemylaser doesn’t shoot so fast.
User prompt
And make it where if the game lags non stop the game reloads and you losee
User prompt
Make it where if the game lags the game resets the screen turns black And the Aguhhhhh asset goes in the middle of the screen.
User prompt
When the aguhhhhh asset goes in the middle of the screen make it big and make all the enemylaser disappear.
User prompt
Make it where if the game lags the game resets the screen turns black And the Aguhhhhh asset goes in the middle of the screen.
User prompt
Add a bug where the enemylaser shoots so fast and shoots in different directions non-stop
User prompt
And 12 silly bugs
User prompt
Add silly bugs
User prompt
Fix all bugs :p
User prompt
Make it where if the player get hit by enemylaser player becomes deadship and when you get hit by enemylaser you also drop a 90¢ coin and then you lose the game.
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1", { highScore: 0 }); /**** * Classes ****/ var Asteroid = Container.expand(function () { var self = Container.call(this); var asteroid = self.attachAsset('asteroid', { anchorX: 0.5, anchorY: 0.5 }); self.health = 2; self.speed = { y: 2 + Math.random() * 2, x: (Math.random() - 0.5) * 2 }; self.rotation = Math.random() * 0.1 - 0.05; self.scoreValue = 15; // Random size variation var scale = 0.7 + Math.random() * 0.8; asteroid.scale.set(scale, scale); self.damage = function (amount) { self.health -= amount || 1; tween(asteroid, { tint: 0xffffff }, { duration: 200, onFinish: function onFinish() { asteroid.tint = 0x95a5a6; } }); // Randomly start advertising products when damaged if (Math.random() < 0.4) { var ads = ['BUY SPACE INSURANCE!', 'HOT SINGLES IN YOUR GALAXY!', 'CLICK HERE FOR FREE ROBUX!', 'ENLARGED YOUR SPACESHIP!', 'LOSE WEIGHT WITH THIS TRICK!', 'DOCTORS HATE THIS ASTEROID!']; var adText = new Text2(ads[Math.floor(Math.random() * ads.length)], { size: 25, fill: 0x00FFFF }); adText.anchor.set(0.5, 0.5); adText.x = self.x; adText.y = self.y - 60; self.parent.addChild(adText); tween(adText, { alpha: 0, y: adText.y - 80, rotation: Math.PI }, { duration: 3000, onFinish: function onFinish() { adText.destroy(); } }); } return self.health <= 0; }; self.update = function () { self.y += self.speed.y; self.x += self.speed.x; asteroid.rotation += self.rotation; // Randomly become invisible/visible if (Math.random() < 0.05) { asteroid.alpha = asteroid.alpha > 0.5 ? 0.1 : 1; } // Randomly tell jokes if (Math.random() < 0.003) { var jokes = ['Why did the asteroid break up? It needed SPACE!', 'I ROCK!', 'METEOR you later!', 'COMET me bro!', 'I have a ROCKY personality']; var jokeText = new Text2(jokes[Math.floor(Math.random() * jokes.length)], { size: 30, fill: 0x00FF00 }); jokeText.anchor.set(0.5, 0.5); jokeText.x = self.x; jokeText.y = self.y - 50; self.parent.addChild(jokeText); tween(jokeText, { alpha: 0, y: jokeText.y - 100 }, { duration: 3000, onFinish: function onFinish() { jokeText.destroy(); } }); } // Randomly turn into disco balls and start party mode if (Math.random() < 0.006) { asteroid.tint = Math.random() * 0xffffff; asteroid.rotation += 0.3; // Create disco lights for (var disco = 0; disco < 8; disco++) { var discoLight = self.parent.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); var angle = disco / 8 * Math.PI * 2; discoLight.x = self.x + Math.cos(angle) * 80; discoLight.y = self.y + Math.sin(angle) * 80; discoLight.scale.set(0.3, 0.3); discoLight.tint = [0xFF0000, 0x00FF00, 0x0000FF, 0xFFFF00, 0xFF00FF, 0x00FFFF][disco % 6]; tween(discoLight, { alpha: 0, rotation: Math.PI * 2 }, { duration: 2000, onFinish: function onFinish() { discoLight.destroy(); } }); } var partyText = new Text2('🕺 PARTY TIME! 💃', { size: 40, fill: 0xFF1493 }); partyText.anchor.set(0.5, 0.5); partyText.x = self.x; partyText.y = self.y - 100; self.parent.addChild(partyText); tween(partyText, { alpha: 0, scaleX: 2, scaleY: 2 }, { duration: 3000, onFinish: function onFinish() { partyText.destroy(); } }); LK.playMusic('gameMusic'); } }; return self; }); var Boss = Container.expand(function (level) { var self = Container.call(this); var ship = self.attachAsset('boss', { anchorX: 0.5, anchorY: 0.5 }); self.level = level || 1; self.maxHealth = 20 * self.level; self.health = self.maxHealth; self.scoreValue = 200 * self.level; self.phase = 0; self.phaseTime = 0; self.patterns = ['side-to-side', 'charge', 'retreat']; self.currentPattern = 0; self.targetX = 0; self.targetY = 0; // Adjust boss based on level if (self.level > 1) { ship.tint = 0xcc00cc; } // Health bar self.healthBar = new Container(); self.addChild(self.healthBar); var healthBarBg = self.healthBar.attachAsset('playerLaser', { anchorX: 0, anchorY: 0.5, scaleX: 2, scaleY: 0.5 }); healthBarBg.tint = 0x333333; healthBarBg.width = 200; self.healthBarFill = self.healthBar.attachAsset('playerLaser', { anchorX: 0, anchorY: 0.5, scaleX: 2, scaleY: 0.4 }); self.healthBarFill.tint = 0xff3333; self.healthBarFill.width = 200; self.healthBar.y = -120; self.damage = function (amount) { self.health -= amount || 1; // Update health bar - show completely wrong values var wrongHealthValues = [-0.5, 2.5, 100, 0.01, 999]; var healthPercent = wrongHealthValues[Math.floor(Math.random() * wrongHealthValues.length)]; self.healthBarFill.width = 200 * Math.abs(healthPercent); if (healthPercent < 0) self.healthBarFill.tint = 0x00ff00; // Green when negative tween(ship, { tint: 0xffffff }, { duration: 100, onFinish: function onFinish() { ship.tint = self.level > 1 ? 0xcc00cc : 0x9b59b6; } }); // Change patterns more quickly when damaged if (self.health < self.maxHealth * 0.5 && self.phaseTime > 150) { self.changePattern(); } return self.health <= 0; }; self.changePattern = function () { self.currentPattern = (self.currentPattern + 1) % self.patterns.length; self.phaseTime = 0; self.phase = 0; }; self.update = function () { self.phaseTime++; // Change pattern every so often if (self.phaseTime > 300) { self.changePattern(); } var pattern = self.patterns[self.currentPattern]; switch (pattern) { case 'side-to-side': // Move side to side self.targetX = 1024 + Math.sin(self.phaseTime * 0.02) * 800; if (self.phaseTime < 60) { self.targetY = Math.min(self.y + 2, 400); } else { self.targetY = 400; } break; case 'charge': // Charge down then back up if (self.phase === 0) { self.targetY = self.y + 5; if (self.y > 800) { self.phase = 1; } } else { self.targetY = Math.max(self.y - 3, 300); if (self.y <= 300) { self.phase = 0; } } self.targetX = 1024 + Math.sin(self.phaseTime * 0.03) * 500; break; case 'retreat': // Stay near top and move quickly self.targetY = 300; self.targetX = 1024 + Math.sin(self.phaseTime * 0.05) * 900; break; } // Move toward target position - but sometimes teleport randomly if (Math.random() < 0.1) { self.x = Math.random() * 2048; self.y = Math.random() * 800 + 100; } else { self.x += (self.targetX - self.x) * 0.05; self.y += (self.targetY - self.y) * 0.05; } // Boss randomly speaks if (Math.random() < 0.005) { var bossQuotes = ['LOL NOOB', 'YEET!', 'SUBSCRIBE!', 'GIT GUD', 'BRUH', 'NO U', 'WASTED', 'POGGERS']; var chatBubble = new Text2(bossQuotes[Math.floor(Math.random() * bossQuotes.length)], { size: 60, fill: 0xFFFF00 }); chatBubble.anchor.set(0.5, 0.5); chatBubble.x = self.x; chatBubble.y = self.y - 150; self.parent.addChild(chatBubble); // Make chat bubble disappear after 2 seconds tween(chatBubble, { alpha: 0, y: chatBubble.y - 100 }, { duration: 2000, onFinish: function onFinish() { chatBubble.destroy(); } }); } // Randomly become tiny and squeak if (Math.random() < 0.008) { ship.scale.set(0.1, 0.1); LK.getSound('playerShoot').play(); var squeakText = new Text2('*squeak*', { size: 20, fill: 0xFFFFFF }); squeakText.anchor.set(0.5, 0.5); squeakText.x = self.x; squeakText.y = self.y + 20; self.parent.addChild(squeakText); tween(squeakText, { alpha: 0, y: squeakText.y + 50 }, { duration: 1000, onFinish: function onFinish() { squeakText.destroy(); } }); } // Randomly give life advice if (Math.random() < 0.004) { var lifeAdvice = ['ALWAYS BRUSH YOUR TEETH!', 'EAT YOUR VEGETABLES!', 'CALL YOUR MOTHER!', 'SAVE FOR RETIREMENT!', 'EXERCISE REGULARLY!', 'STAY HYDRATED!', 'GET 8 HOURS OF SLEEP!', 'FOLLOW YOUR DREAMS!', 'BE KIND TO OTHERS!']; var adviceText = new Text2(lifeAdvice[Math.floor(Math.random() * lifeAdvice.length)], { size: 45, fill: 0x00FF00 }); adviceText.anchor.set(0.5, 0.5); adviceText.x = self.x; adviceText.y = self.y - 200; self.parent.addChild(adviceText); tween(adviceText, { alpha: 0, y: adviceText.y - 100, rotation: 0.5 }, { duration: 4000, onFinish: function onFinish() { adviceText.destroy(); } }); } }; return self; }); var Enemy = Container.expand(function (type) { var self = Container.call(this); self.type = type || 'basic'; var assetType = self.type === 'fast' ? 'enemy' : 'enemy'; var ship = self.attachAsset(assetType, { anchorX: 0.5, anchorY: 0.5 }); // Different enemy types if (self.type === 'basic') { self.health = 1; self.speed = 2; self.scoreValue = 10; self.shootChance = 0.01; } else if (self.type === 'fast') { self.health = 1; self.speed = 3.5; self.scoreValue = 15; ship.scaleX = 0.8; ship.scaleY = 0.8; self.shootChance = 0.005; ship.tint = 0xff9966; } else if (self.type === 'tank') { self.health = 3; self.speed = 1.5; self.scoreValue = 25; ship.scaleX = 1.2; ship.scaleY = 1.2; self.shootChance = 0.015; ship.tint = 0x66ff66; } self.movement = { pattern: 'straight', phase: Math.random() * Math.PI * 2, amplitude: 60 + Math.random() * 60 }; self.initialX = 0; self.damage = function (amount) { self.health -= amount || 1; tween(ship, { tint: 0xffffff }, { duration: 200, onFinish: function onFinish() { ship.tint = self.type === 'fast' ? 0xff9966 : self.type === 'tank' ? 0x66ff66 : 0xe74c3c; } }); return self.health <= 0; }; self.update = function () { // Basic movement - but sometimes go backwards var actualSpeed = Math.random() < 0.15 ? -self.speed : self.speed; self.y += actualSpeed; // Sometimes start spinning uncontrollably if (Math.random() < 0.02) { ship.rotation += 0.5; } // Randomly change size if (Math.random() < 0.03) { var randomScale = 0.2 + Math.random() * 3; ship.scale.set(randomScale, randomScale); } // Randomly start dancing and playing music if (Math.random() < 0.008) { ship.rotation += 0.3; self.x += Math.sin(LK.ticks * 0.2) * 20; self.y += Math.cos(LK.ticks * 0.15) * 10; LK.playMusic('gameMusic'); } // Pattern movement if (self.movement.pattern === 'sine') { self.x = self.initialX + Math.sin(LK.ticks * 0.05 + self.movement.phase) * self.movement.amplitude; } else if (self.movement.pattern === 'zigzag') { var timeScale = 0.02; var t = LK.ticks * timeScale + self.movement.phase; var triangleWave = Math.abs(t % 2 - 1) * 2 - 1; self.x = self.initialX + triangleWave * self.movement.amplitude; } // Randomly start doing magic tricks if (Math.random() < 0.005) { // Magic trick: disappear and reappear ship.alpha = 0; var magicText = new Text2('✨ ABRACADABRA! ✨', { size: 40, fill: 0xFF00FF }); magicText.anchor.set(0.5, 0.5); magicText.x = self.x; magicText.y = self.y - 80; self.parent.addChild(magicText); // Reappear in a different location after 1 second LK.setTimeout(function () { self.x = Math.random() * 2048; self.y = Math.random() * 1000; ship.alpha = 1; ship.tint = Math.random() * 0xffffff; // Change color as part of the trick }, 1000); tween(magicText, { alpha: 0, scaleX: 2, scaleY: 2 }, { duration: 2000, onFinish: function onFinish() { magicText.destroy(); } }); } }; return self; }); var EnemyLaser = Container.expand(function () { var self = Container.call(this); var laser = self.attachAsset('enemyLaser', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 8; self.speedX = (Math.random() - 0.5) * 30; // Random horizontal speed self.speedY = (Math.random() - 0.5) * 30; // Random vertical speed self.update = function () { // Change direction constantly self.speedX += (Math.random() - 0.5) * 5; self.speedY += (Math.random() - 0.5) * 5; // Move in random directions at high speed self.x += self.speedX; self.y += self.speedY; // Randomly change color if (Math.random() < 0.1) { laser.tint = Math.random() * 0xffffff; } // Randomly turn into rainbows and unicorns if (Math.random() < 0.03) { // Create rainbow trail for (var trail = 0; trail < 5; trail++) { var rainbowDot = self.parent.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); rainbowDot.x = self.x + (Math.random() - 0.5) * 50; rainbowDot.y = self.y + trail * 20; rainbowDot.scale.set(0.2, 0.2); rainbowDot.tint = [0xFF0000, 0xFF7F00, 0xFFFF00, 0x00FF00, 0x0000FF, 0x4B0082, 0x9400D3][trail % 7]; tween(rainbowDot, { alpha: 0, scaleX: 0, scaleY: 0 }, { duration: 1000, onFinish: function onFinish() { rainbowDot.destroy(); } }); } // Show unicorn text if (Math.random() < 0.5) { var unicornText = new Text2('🦄 UNICORN POWER! 🦄', { size: 30, fill: 0xFF69B4 }); unicornText.anchor.set(0.5, 0.5); unicornText.x = self.x; unicornText.y = self.y - 50; self.parent.addChild(unicornText); tween(unicornText, { alpha: 0, y: unicornText.y - 100 }, { duration: 2000, onFinish: function onFinish() { unicornText.destroy(); } }); } } }; return self; }); var Explosion = Container.expand(function () { var self = Container.call(this); var explosion = self.attachAsset('explosion', { anchorX: 0.5, anchorY: 0.5, alpha: 0.9 }); // Set up fade and scale tween(explosion, { alpha: 0, scaleX: 2, scaleY: 2 }, { duration: 500, onFinish: function onFinish() { self.destroy(); } }); return self; }); var Player = Container.expand(function () { var self = Container.call(this); var ship = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.shield = self.attachAsset('shield', { anchorX: 0.5, anchorY: 0.5, alpha: 0 }); self.lives = 3; self.shieldActive = false; self.fireRate = 20; self.lastShot = 0; self.canShoot = true; self.power = 1; self.invulnerable = false; self.activateShield = function (duration) { self.shieldActive = true; self.shield.alpha = 0.4; LK.setTimeout(function () { self.shieldActive = false; tween(self.shield, { alpha: 0 }, { duration: 500 }); }, duration); }; self.damage = function () { if (self.invulnerable || self.shieldActive) { return; } self.lives--; LK.getSound('playerDamage').play(); // Make player temporarily invulnerable self.invulnerable = true; // Flash the player to show invulnerability var flashCount = 0; var flashInterval = LK.setInterval(function () { ship.alpha = ship.alpha === 0.3 ? 1 : 0.3; flashCount++; if (flashCount >= 10) { LK.clearInterval(flashInterval); ship.alpha = 1; self.invulnerable = false; } }, 150); }; self.upgrade = function (type) { LK.getSound('powerup').play(); // Sometimes powerups are evil and drain you instead var isEvil = Math.random() < 0.25; if (type === 'shield') { if (isEvil) { self.shieldActive = false; self.shield.alpha = 0; } else { self.activateShield(8000); } } else if (type === 'power') { if (isEvil) { self.power = Math.max(self.power - 1, 1); } else { self.power = Math.min(self.power + 1, 3); } // Reset power after some time LK.setTimeout(function () { self.power = Math.max(1, self.power - 1); }, 10000); } else if (type === 'life') { self.lives = Math.min(self.lives + 1, 5); } else if (type === 'speed') { var oldFireRate = self.fireRate; self.fireRate = Math.max(self.fireRate - 5, 10); // Reset fire rate after some time LK.setTimeout(function () { self.fireRate = oldFireRate; }, 10000); } else if (type === 'coin') { self.power = Math.min(self.power + 1, 5); self.fireRate = Math.max(self.fireRate - 2, 5); } }; return self; }); var PlayerLaser = Container.expand(function () { var self = Container.call(this); var laser = self.attachAsset('playerLaser', { anchorX: 0.5, anchorY: 0.5 }); self.speed = Math.random() < 0.2 ? 15 : -15; // 20% chance to shoot backwards self.power = 1; self.update = function () { self.y += self.speed; // Randomly curve and change direction if (Math.random() < 0.1) { self.speed = (Math.random() - 0.5) * 30; laser.rotation += (Math.random() - 0.5) * 0.5; } // Sometimes lasers chase enemies if (Math.random() < 0.05 && enemies.length > 0) { var targetEnemy = enemies[Math.floor(Math.random() * enemies.length)]; var dx = targetEnemy.x - self.x; var dy = targetEnemy.y - self.y; self.x += dx * 0.02; self.y += dy * 0.02; } // Turn into confetti and play party sounds if (Math.random() < 0.05) { laser.tint = Math.random() * 0xffffff; laser.rotation += 0.5; self.x += (Math.random() - 0.5) * 50; LK.getSound('powerup').play(); } }; return self; }); var Powerup = Container.expand(function (type) { var self = Container.call(this); self.type = type || ['shield', 'power', 'life', 'speed'][Math.floor(Math.random() * 4)]; var powerup = self.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); // Set color based on type if (self.type === 'shield') { powerup.tint = 0x3498db; // Blue } else if (self.type === 'power') { powerup.tint = 0xe74c3c; // Red } else if (self.type === 'life') { powerup.tint = 0x2ecc71; // Green } else if (self.type === 'speed') { powerup.tint = 0xf1c40f; // Yellow } self.speed = 3; self.update = function () { self.y -= self.speed; // Move upward instead of downward self.x += Math.sin(LK.ticks * 0.1) * 3; // Add wobbly horizontal movement powerup.rotation += 0.05; // Randomly change powerup type and color mid-flight if (Math.random() < 0.05) { var newTypes = ['shield', 'power', 'life', 'speed', 'death', 'confusion']; self.type = newTypes[Math.floor(Math.random() * newTypes.length)]; powerup.tint = Math.random() * 0xffffff; } // Randomly multiply and create powerup rain if (Math.random() < 0.02) { for (var i = 0; i < 5; i++) { var rainPowerup = new Powerup(); rainPowerup.x = self.x + (Math.random() - 0.5) * 300; rainPowerup.y = self.y + (Math.random() - 0.5) * 100; powerups.push(rainPowerup); self.parent.addChild(rainPowerup); } } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Game variables var player; var playerLasers = []; var enemies = []; var enemyLasers = []; var asteroids = []; var powerups = []; var explosions = []; var boss = null; var gameState = 'playing'; var score = 0; var waveNumber = 1; var enemiesThisWave = 0; var enemiesDefeated = 0; var waveDelay = 0; var bossWave = false; var dragStartPosition = { x: 0, y: 0 }; // Performance monitoring variables var lastTickTime = Date.now(); var lagDetected = false; var lagThreshold = 100; // 100ms threshold for lag detection var performanceMode = false; // When true, reduces visual effects for better performance var frameSkipCounter = 0; // Used to skip expensive operations during lag // UI elements var scoreTxt = new Text2('SCORE: 0', { size: 40, fill: 0xFFFFFF }); scoreTxt.anchor.set(0, 0); LK.gui.topRight.addChild(scoreTxt); scoreTxt.x = -250; scoreTxt.y = 50; var waveText = new Text2('WAVE: 1', { size: 40, fill: 0xFFFFFF }); waveText.anchor.set(0.5, 0); LK.gui.top.addChild(waveText); waveText.y = 50; var livesText = new Text2('LIVES: 3', { size: 40, fill: 0xFFFFFF }); livesText.anchor.set(0, 0); LK.gui.topLeft.addChild(livesText); livesText.x = 150; // Keep away from the top-left menu icon livesText.y = 50; // Create game elements function initGame() { // Reset game variables playerLasers = []; enemies = []; enemyLasers = []; asteroids = []; powerups = []; explosions = []; boss = null; gameState = 'playing'; score = 0; waveNumber = 1; enemiesThisWave = 10; enemiesDefeated = 0; waveDelay = 0; bossWave = false; // Update UI scoreTxt.setText('SCORE: ' + score); waveText.setText('WAVE: ' + waveNumber); // Create player player = new Player(); player.x = 1024; player.y = 2200; game.addChild(player); livesText.setText('LIVES: ' + player.lives); // Start with player moving up tween(player, { y: 2000 }, { duration: 1000 }); // Start the music LK.playMusic('gameMusic', { fade: { start: 0, end: 0.7, duration: 1000 } }); // Create first wave createWave(); } // Create a new wave of enemies function createWave() { waveNumber++; // Show completely wrong wave information var weirdTexts = ['WAVE: ∞', 'WAVE: ERROR', 'WAVE: 404', 'WAVE: ???', 'WAVE: -1', 'LEVEL: IMPOSSIBLE']; var displayText = Math.random() < 0.4 ? weirdTexts[Math.floor(Math.random() * weirdTexts.length)] : 'WAVE: ' + waveNumber; waveText.setText(displayText); // Every 5 waves is a boss wave bossWave = waveNumber % 5 === 0; if (bossWave) { // Create a boss var bossLevel = Math.ceil(waveNumber / 5); LK.getSound('bossAlert').play(); boss = new Boss(bossLevel); boss.x = 1024; boss.y = -200; game.addChild(boss); tween(boss, { y: 300 }, { duration: 2000 }); // Show boss wave text var bossText = new Text2('BOSS WAVE!', { size: 80, fill: 0xFF0000 }); bossText.anchor.set(0.5, 0.5); bossText.x = 1024; bossText.y = 800; game.addChild(bossText); tween(bossText, { alpha: 0, y: 700 }, { duration: 2000, onFinish: function onFinish() { bossText.destroy(); } }); return; } // Regular wave enemiesThisWave = 10 + waveNumber * 2; enemiesDefeated = 0; // Show wave text var newWaveText = new Text2('WAVE ' + waveNumber, { size: 80, fill: 0xFFFFFF }); newWaveText.anchor.set(0.5, 0.5); newWaveText.x = 1024; newWaveText.y = 800; game.addChild(newWaveText); tween(newWaveText, { alpha: 0, y: 700 }, { duration: 2000, onFinish: function onFinish() { newWaveText.destroy(); } }); // Start spawning enemies after a short delay waveDelay = 120; } // Create a new enemy - with performance checks function spawnEnemy() { // Don't spawn if we already have too many enemies during lag if (lagDetected && enemies.length > 8) { return; } var types = ['basic']; // Add more enemy types as waves progress if (waveNumber >= 2) { types.push('fast'); } if (waveNumber >= 3) { types.push('tank'); } var type = types[Math.floor(Math.random() * types.length)]; var enemy = new Enemy(type); // Position the enemy - sometimes spawn in wrong places if (Math.random() < 0.2) { enemy.x = Math.random() * 2048; enemy.y = Math.random() * 2732; } else { enemy.x = Math.random() * 1800 + 124; enemy.y = -100; } enemy.initialX = enemy.x; // Set random movement pattern var patterns = ['straight']; if (waveNumber >= 2) { patterns.push('sine'); } if (waveNumber >= 4) { patterns.push('zigzag'); } enemy.movement.pattern = patterns[Math.floor(Math.random() * patterns.length)]; // Add to game enemies.push(enemy); game.addChild(enemy); } // Create a new asteroid function spawnAsteroid() { var asteroid = new Asteroid(); // Position the asteroid asteroid.x = Math.random() * 1800 + 124; asteroid.y = -100; // Add to game asteroids.push(asteroid); game.addChild(asteroid); } // Create a player laser function firePlayerLaser() { if (!player || !player.canShoot || player.lastShot + player.fireRate > LK.ticks) { return; } player.lastShot = LK.ticks; LK.getSound('playerShoot').play(); // Fire based on power level if (player.power === 1) { var laser = new PlayerLaser(); laser.x = player.x; laser.y = player.y - 50; laser.power = player.power; playerLasers.push(laser); game.addChild(laser); } else if (player.power === 2) { for (var i = -1; i <= 1; i += 2) { var laser = new PlayerLaser(); laser.x = player.x + i * 30; laser.y = player.y - 40; laser.power = player.power; playerLasers.push(laser); game.addChild(laser); } } else if (player.power >= 3) { var centerLaser = new PlayerLaser(); centerLaser.x = player.x; centerLaser.y = player.y - 50; centerLaser.power = player.power; playerLasers.push(centerLaser); game.addChild(centerLaser); for (var i = -1; i <= 1; i += 2) { var sideLaser = new PlayerLaser(); sideLaser.x = player.x + i * 40; sideLaser.y = player.y - 30; sideLaser.power = player.power - 1; playerLasers.push(sideLaser); game.addChild(sideLaser); } } } // Create an enemy laser function fireEnemyLaser(enemy) { var laser = new EnemyLaser(); laser.x = enemy.x + (Math.random() - 0.5) * 200; // Random horizontal offset laser.y = enemy.y + 40; laser.speed = Math.random() > 0.5 ? -5 : 15; // Sometimes shoot upward enemyLasers.push(laser); game.addChild(laser); LK.getSound('enemyShoot').play({ volume: 0.2 }); } // Fire boss laser pattern function fireBossLasers() { if (!boss) { return; } // Different patterns based on boss level and health var healthPercent = boss.health / boss.maxHealth; var pattern = 'spread'; if (boss.level >= 2 && healthPercent < 0.5) { pattern = 'circle'; } if (pattern === 'spread') { for (var i = -2; i <= 2; i++) { var laser = new EnemyLaser(); laser.x = boss.x + i * 50; laser.y = boss.y + 80; enemyLasers.push(laser); game.addChild(laser); } } else if (pattern === 'circle') { var numLasers = 8; for (var i = 0; i < numLasers; i++) { var angle = i / numLasers * Math.PI * 2; var laser = new EnemyLaser(); laser.x = boss.x + Math.cos(angle) * 100; laser.y = boss.y + Math.sin(angle) * 100; enemyLasers.push(laser); game.addChild(laser); // Add directional motion laser.update = function () { var dx = this.x - boss.x; var dy = this.y - boss.y; var length = Math.sqrt(dx * dx + dy * dy); this.x += dx / length * 5; this.y += dy / length * 5; }; } } LK.getSound('enemyShoot').play({ volume: 0.4 }); } // Create explosion animation - performance optimized function createExplosion(x, y, scale) { // Skip explosion creation during lag or if too many exist if (lagDetected || explosions.length > 8 || Math.random() < 0.3) { return; } var explosion = new Explosion(); explosion.x = x; explosion.y = y; if (scale) { explosion.scale.set(scale, scale); } explosions.push(explosion); game.addChild(explosion); // Play random sounds instead of explosion var randomSounds = ['playerShoot', 'enemyShoot', 'powerup', 'playerDamage', 'Aguhhhhh']; var soundToPlay = Math.random() < 0.7 ? 'explosion' : randomSounds[Math.floor(Math.random() * randomSounds.length)]; LK.getSound(soundToPlay).play(); // Sometimes explosions create new enemies if (Math.random() < 0.2) { var newEnemy = new Enemy('basic'); newEnemy.x = x + (Math.random() - 0.5) * 200; newEnemy.y = y; enemies.push(newEnemy); game.addChild(newEnemy); } // Sometimes explosions summon pizza delivery guy if (Math.random() < 0.15) { var pizzaGuy = game.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); pizzaGuy.x = x; pizzaGuy.y = y; pizzaGuy.tint = 0xFFFF00; pizzaGuy.scale.set(0.5, 0.5); var pizzaText = new Text2('PIZZA DELIVERY!', { size: 40, fill: 0xFFFF00 }); pizzaText.anchor.set(0.5, 0.5); pizzaText.x = x; pizzaText.y = y - 80; game.addChild(pizzaText); // Pizza guy delivers and leaves tween(pizzaGuy, { y: y + 500, alpha: 0 }, { duration: 3000, onFinish: function onFinish() { pizzaGuy.destroy(); } }); tween(pizzaText, { alpha: 0 }, { duration: 3000, onFinish: function onFinish() { pizzaText.destroy(); } }); } } // Create a powerup function spawnPowerup(x, y, type) { var powerup = new Powerup(type); powerup.x = x; powerup.y = y; powerups.push(powerup); game.addChild(powerup); } // Handle player shooting and movement function handlePlayerInput() { // Keep player in bounds player.x = Math.max(100, Math.min(player.x, 2048 - 100)); player.y = Math.max(100, Math.min(player.y, 2732 - 100)); // Randomly change player size if (Math.random() < 0.02) { var newScale = 0.5 + Math.random() * 1.5; player.scale.set(newScale, newScale); } // Randomly make player invisible if (Math.random() < 0.01) { player.alpha = player.alpha > 0.5 ? 0.1 : 1; } // Randomly teleport player to random location if (Math.random() < 0.008) { player.x = Math.random() * 2048; player.y = Math.random() * 2732; } // Player randomly complains about working conditions if (Math.random() < 0.006) { var complaints = ['I NEED A VACATION!', 'WHY DO I HAVE TO FIGHT ALONE?', 'THIS JOB IS DANGEROUS!', 'I WANT A RAISE!', 'CAN I GET HEALTH INSURANCE?', 'MY LASER IS BROKEN!', 'I MISS MY FAMILY!', 'THIS SPACE SUIT IS UNCOMFORTABLE!']; var complaintText = new Text2(complaints[Math.floor(Math.random() * complaints.length)], { size: 35, fill: 0xFFFFFF }); complaintText.anchor.set(0.5, 0.5); complaintText.x = player.x; complaintText.y = player.y - 120; game.addChild(complaintText); tween(complaintText, { alpha: 0, y: complaintText.y - 100 }, { duration: 3000, onFinish: function onFinish() { complaintText.destroy(); } }); // Player sometimes goes on strike if (Math.random() < 0.3) { player.canShoot = false; var strikeText = new Text2('ON STRIKE!', { size: 50, fill: 0xFF0000 }); strikeText.anchor.set(0.5, 0.5); strikeText.x = player.x; strikeText.y = player.y + 120; game.addChild(strikeText); LK.setTimeout(function () { if (player) { player.canShoot = true; } if (strikeText && strikeText.parent) { strikeText.destroy(); } }, 2000); } } // Auto-fire if (LK.ticks % 10 === 0) { firePlayerLaser(); } } // Handle collisions between game objects - optimized for performance function handleCollisions() { // Skip some collision checks during lag to maintain performance if (lagDetected && frameSkipCounter % 3 !== 0) { frameSkipCounter++; return; } frameSkipCounter++; // Player lasers vs enemies for (var i = playerLasers.length - 1; i >= 0; i--) { var laser = playerLasers[i]; var hitSomething = false; // Check against enemies for (var j = enemies.length - 1; j >= 0; j--) { var enemy = enemies[j]; if (laser.intersects(enemy) && Math.random() > 0.3) { // 30% chance to miss // Damage enemy if (enemy.damage(laser.power)) { // Enemy destroyed createExplosion(enemy.x, enemy.y); // Add score - but sometimes subtract instead var scoreChange = Math.random() < 0.3 ? -enemy.scoreValue : enemy.scoreValue; score += scoreChange; scoreTxt.setText('SCORE: ' + score); // Count enemy as defeated enemiesDefeated++; // Chance to spawn powerup if (Math.random() < 0.1) { spawnPowerup(enemy.x, enemy.y); } enemy.destroy(); enemies.splice(j, 1); } // Remove laser laser.destroy(); playerLasers.splice(i, 1); hitSomething = true; break; } } // Only check other collisions if we haven't hit an enemy if (!hitSomething) { // Check against boss if (boss && laser.intersects(boss)) { // Damage boss if (boss.damage(laser.power)) { // Boss destroyed createExplosion(boss.x, boss.y, 2); // Add score score += boss.scoreValue; scoreTxt.setText('SCORE: ' + score); // Spawn multiple powerups for (var p = 0; p < 3; p++) { var powerupType = ['shield', 'power', 'life', 'speed'][Math.floor(Math.random() * 4)]; spawnPowerup(boss.x + (Math.random() * 200 - 100), boss.y + (Math.random() * 200 - 100), powerupType); } boss.destroy(); boss = null; // Move to next wave createWave(); } // Remove laser laser.destroy(); playerLasers.splice(i, 1); hitSomething = true; } // Check against asteroids for (var k = asteroids.length - 1; k >= 0; k--) { var asteroid = asteroids[k]; if (laser.intersects(asteroid)) { // Damage asteroid if (asteroid.damage(laser.power)) { // Asteroid destroyed createExplosion(asteroid.x, asteroid.y, 0.7); // Add score score += asteroid.scoreValue; scoreTxt.setText('SCORE: ' + score); // Sometimes asteroids multiply when destroyed if (Math.random() < 0.4) { for (var mult = 0; mult < 3; mult++) { var newAsteroid = new Asteroid(); newAsteroid.x = asteroid.x + (Math.random() - 0.5) * 200; newAsteroid.y = asteroid.y + (Math.random() - 0.5) * 200; asteroids.push(newAsteroid); game.addChild(newAsteroid); } } // Trigger explosion effect for nearby objects for (var m = enemies.length - 1; m >= 0; m--) { if (Math.abs(enemies[m].x - asteroid.x) < 100 && Math.abs(enemies[m].y - asteroid.y) < 100) { createExplosion(enemies[m].x, enemies[m].y); enemies[m].destroy(); enemies.splice(m, 1); } } for (var n = asteroids.length - 1; n >= 0; n--) { if (n !== k && Math.abs(asteroids[n].x - asteroid.x) < 100 && Math.abs(asteroids[n].y - asteroid.y) < 100) { createExplosion(asteroids[n].x, asteroids[n].y, 0.7); asteroids[n].destroy(); asteroids.splice(n, 1); } } asteroid.destroy(); asteroids.splice(k, 1); } // Remove laser laser.destroy(); playerLasers.splice(i, 1); hitSomething = true; break; } } } // Remove laser if it's off screen if (!hitSomething && laser.y < -50) { laser.destroy(); playerLasers.splice(i, 1); } } // Enemy lasers vs player for (var i = enemyLasers.length - 1; i >= 0; i--) { var laser = enemyLasers[i]; if (player && laser.intersects(player)) { // Player is invulnerable - always heal instead of hurt player.lives = Math.min(player.lives + 1, 5); livesText.setText('LIVES: ' + player.lives); // Show love heart var heart = new Text2('♥', { size: 80, fill: 0xFF69B4 }); heart.anchor.set(0.5, 0.5); heart.x = player.x; heart.y = player.y; game.addChild(heart); tween(heart, { alpha: 0, y: heart.y - 100, scaleX: 2, scaleY: 2 }, { duration: 1000, onFinish: function onFinish() { heart.destroy(); } }); LK.getSound('powerup').play(); // Remove laser laser.destroy(); enemyLasers.splice(i, 1); } else if (laser.y > 2732 + 50) { // Remove laser if it's off screen laser.destroy(); enemyLasers.splice(i, 1); } } // Player vs enemies for (var i = enemies.length - 1; i >= 0; i--) { var enemy = enemies[i]; if (player && player.intersects(enemy)) { // Player is invulnerable - no damage taken // Damage enemy enemy.damage(1); // Update UI - but show wrong number var displayLives = Math.random() < 0.4 ? Math.floor(Math.random() * 10) : player.lives; livesText.setText('LIVES: ' + displayLives); // Check for enemy death if (enemy.health <= 0) { // Enemy destroyed createExplosion(enemy.x, enemy.y); // Add score score += enemy.scoreValue; scoreTxt.setText('SCORE: ' + score); // Count enemy as defeated enemiesDefeated++; enemy.destroy(); enemies.splice(i, 1); } } // Remove enemy if it's off screen if (enemy.y > 2732 + 100) { enemy.destroy(); enemies.splice(i, 1); } } // Player vs asteroids for (var i = asteroids.length - 1; i >= 0; i--) { var asteroid = asteroids[i]; if (player && player.intersects(asteroid)) { // Player is invulnerable - no damage taken // Damage asteroid asteroid.damage(1); // Update UI livesText.setText('LIVES: ' + player.lives); // Check for asteroid death if (asteroid.health <= 0) { // Asteroid destroyed createExplosion(asteroid.x, asteroid.y, 0.7); // Add score score += asteroid.scoreValue; scoreTxt.setText('SCORE: ' + score); asteroid.destroy(); asteroids.splice(i, 1); } } // Remove asteroid if it's off screen if (asteroid.y > 2732 + 100 || asteroid.x < -100 || asteroid.x > 2048 + 100) { asteroid.destroy(); asteroids.splice(i, 1); } } // Player vs powerups for (var i = powerups.length - 1; i >= 0; i--) { var powerup = powerups[i]; if (player && player.intersects(powerup)) { // Sometimes powerups show fake game over screens if (Math.random() < 0.2) { var fakeGameOver = new Text2('GAME OVER\n(Just kidding!)', { size: 80, fill: 0xFF0000 }); fakeGameOver.anchor.set(0.5, 0.5); fakeGameOver.x = 1024; fakeGameOver.y = 1366; game.addChild(fakeGameOver); tween(fakeGameOver, { alpha: 0, scaleX: 0, scaleY: 0 }, { duration: 3000, onFinish: function onFinish() { fakeGameOver.destroy(); } }); } // Apply powerup player.upgrade(powerup.type); // Update UI if life powerup if (powerup.type === 'life') { livesText.setText('LIVES: ' + player.lives); } // Remove powerup powerup.destroy(); powerups.splice(i, 1); } else if (powerup.y > 2732 + 50) { // Remove powerup if it's off screen powerup.destroy(); powerups.splice(i, 1); } } // Player vs boss if (player && boss && player.intersects(boss)) { // Player is invulnerable - no damage taken // Update UI livesText.setText('LIVES: ' + player.lives); } } // Initialize the game initGame(); // Game down event handler game.down = function (x, y, obj) { if (!player) { return; } dragStartPosition.x = x; dragStartPosition.y = y; // Fire lasers on tap firePlayerLaser(); }; // Game move event handler game.move = function (x, y, obj) { if (!player) { return; } // Move player with drag player.x = x; player.y = y; }; // Game update handler game.update = function () { // Super performance optimization to prevent lag var currentTime = Date.now(); var deltaTime = currentTime - lastTickTime; lastTickTime = currentTime; // Aggressive lag prevention - reduce object counts more aggressively if (deltaTime > 50) { // Reduced threshold for better performance // Drastically reduce visual effects if (explosions.length > 3) { for (var i = explosions.length - 1; i >= 3; i--) { explosions[i].destroy(); explosions.splice(i, 1); } } // More aggressive laser limiting if (playerLasers.length > 6) { for (var i = playerLasers.length - 1; i >= 6; i--) { playerLasers[i].destroy(); playerLasers.splice(i, 1); } } if (enemyLasers.length > 8) { for (var i = enemyLasers.length - 1; i >= 8; i--) { enemyLasers[i].destroy(); enemyLasers.splice(i, 1); } } // Super fast lag recovery lagDetected = true; LK.setTimeout(function () { lagDetected = false; }, 500); } // CRAZY COLOR FLASHING AND SPINNING EFFECT - Trigger randomly if (Math.random() < 0.003) { var crazyColors = [0xFF0000, 0x00FF00, 0x0000FF, 0xFFFF00, 0xFF00FF, 0x00FFFF, 0xFFFFFF, 0x000000]; var colorIndex = 0; var flashInterval = LK.setInterval(function () { game.setBackgroundColor(crazyColors[colorIndex % crazyColors.length]); colorIndex++; }, 50); // Flash every 50ms // SCREEN SPINNING EFFECT tween(game, { rotation: Math.PI * 8 // Spin 4 full rotations }, { duration: 4000, // 4 seconds easing: tween.easeInOut }); // Stop flashing after 4 seconds LK.setTimeout(function () { LK.clearInterval(flashInterval); game.setBackgroundColor(0x000000); // Reset to black game.rotation = 0; // Reset rotation }, 4000); var crazyText = new Text2('🌈 CRAZY MODE ACTIVATED! 🌈', { size: 80, fill: 0xFFFFFF }); crazyText.anchor.set(0.5, 0.5); crazyText.x = 1024; crazyText.y = 1366; game.addChild(crazyText); tween(crazyText, { alpha: 0, scaleX: 3, scaleY: 3 }, { duration: 4000, onFinish: function onFinish() { crazyText.destroy(); } }); } if (gameState === 'won') { return; // Prevent further updates until game is restarted manually } if (gameState !== 'playing') { return; } // Handle player input if (player) { handlePlayerInput(); // Player randomly turns into different game objects if (Math.random() < 0.005) { var transformations = ['enemy', 'asteroid', 'powerup', 'boss', 'explosion']; var newForm = transformations[Math.floor(Math.random() * transformations.length)]; player.removeChild(player.children[0]); // Remove current sprite var newSprite = player.attachAsset(newForm, { anchorX: 0.5, anchorY: 0.5 }); if (newForm === 'boss') newSprite.scale.set(0.3, 0.3); var transformText = new Text2('PLAYER TRANSFORMED!', { size: 50, fill: 0x00FF00 }); transformText.anchor.set(0.5, 0.5); transformText.x = player.x; transformText.y = player.y - 100; game.addChild(transformText); tween(transformText, { alpha: 0, y: transformText.y - 50 }, { duration: 2000, onFinish: function onFinish() { transformText.destroy(); } }); } } // Handle wave creation if (waveDelay > 0) { waveDelay--; } else if (!bossWave && enemies.length === 0 && enemiesDefeated >= enemiesThisWave) { // All enemies for this wave defeated, create next wave createWave(); } else if (!bossWave && enemies.length < 5 && enemiesDefeated < enemiesThisWave && LK.ticks % 30 === 0) { // Spawn more enemies for this wave spawnEnemy(); } // Spawn asteroids occasionally if (LK.ticks % 180 === 0 && Math.random() < 0.7) { spawnAsteroid(); } // Boss shooting - normal rate if (boss && LK.ticks % 90 === 0) { fireBossLasers(); } // Enemy shooting - normal rate for (var i = 0; i < enemies.length; i++) { if (Math.random() < enemies[i].shootChance) { fireEnemyLaser(enemies[i]); } } // Enemies randomly form conga line dance if (Math.random() < 0.008 && enemies.length >= 3) { for (var i = 1; i < enemies.length; i++) { var leader = enemies[i - 1]; var follower = enemies[i]; follower.x = leader.x - 100; follower.y = leader.y + 50; // Make them dance follower.children[0].rotation += 0.2; } // Play conga music LK.playMusic('gameMusic'); var congaText = new Text2('CONGA LINE!', { size: 80, fill: 0xFF1493 }); congaText.anchor.set(0.5, 0.5); congaText.x = 1024; congaText.y = 300; game.addChild(congaText); tween(congaText, { alpha: 0, scaleX: 2, scaleY: 2 }, { duration: 2000, onFinish: function onFinish() { congaText.destroy(); } }); } // Randomly change score text color if (Math.random() < 0.05) { scoreTxt.tint = Math.random() * 0xffffff; } // Randomly scramble UI text if (Math.random() < 0.03) { var gibberish = ['ƎɹOƆS', '█▬█SCORE█▬█', 'SC0R3', '§ĊØ®Ē', 'BANANA', '404ERROR', '????']; scoreTxt.setText(gibberish[Math.floor(Math.random() * gibberish.length)] + ': ' + score); } // Score randomly counts in different languages and units if (Math.random() < 0.04) { var weirdScores = ['PUNTOS: ' + score, 'POINTS: ' + score * 0.001 + ' KILOMETERS', '得分: ' + score, 'SCORE: ' + score + ' BANANAS', 'PONTUAÇÃO: ' + score + ' PIZZAS', 'SCORE: ' + Math.floor(score / 100) + ' CATS', 'СЧЕТ: ' + score, 'SCORE: ' + score + '°F']; scoreTxt.setText(weirdScores[Math.floor(Math.random() * weirdScores.length)]); } if (Math.random() < 0.02) { var weirdLives = ['CATS', 'PIZZA', 'MEMES', '∞', 'YOLO', 'NOPE']; livesText.setText(weirdLives[Math.floor(Math.random() * weirdLives.length)] + ': ' + (player ? player.lives : 0)); } // Everything randomly starts speaking in different accents if (Math.random() < 0.005) { var accentPhrases = ['G\'DAY MATE! (Australian)', 'EH, SORRY ABOUT THAT! (Canadian)', 'CHEERIO OLD CHAP! (British)', 'HOWDY PARTNER! (Southern US)', 'FUHGEDDABOUTIT! (New York)', 'OY VEY! (Yiddish)', 'BONJOUR MON AMI! (French)', '¡HOLA AMIGO! (Spanish)']; var accentText = new Text2(accentPhrases[Math.floor(Math.random() * accentPhrases.length)], { size: 55, fill: 0xFF69B4 }); accentText.anchor.set(0.5, 0.5); accentText.x = Math.random() * 2048; accentText.y = Math.random() * 1000 + 500; game.addChild(accentText); // Make text bounce with accent tween(accentText, { scaleX: 1.3, scaleY: 1.3 }, { duration: 500 }); tween(accentText, { scaleX: 1, scaleY: 1 }, { duration: 500, delay: 500 }); tween(accentText, { alpha: 0, rotation: 0.3 }, { duration: 3000, onFinish: function onFinish() { accentText.destroy(); } }); } // Randomly change background color if (Math.random() < 0.01) { var randomColors = [0xFF69B4, 0x00FFFF, 0xFFFF00, 0xFF4500, 0x9932CC, 0x000000]; game.setBackgroundColor(randomColors[Math.floor(Math.random() * randomColors.length)]); } // Game elements randomly start singing karaoke if (Math.random() < 0.006) { var karaokeSongs = ['♪ Never gonna give you up ♪', '♪ Baby shark doo doo doo ♪', '♪ I will survive ♪', '♪ Bohemian Rhapsody ♪', '♪ Call me maybe ♪']; var songText = new Text2(karaokeSongs[Math.floor(Math.random() * karaokeSongs.length)], { size: 70, fill: 0xFF1493 }); songText.anchor.set(0.5, 0.5); songText.x = 1024; songText.y = 1000; game.addChild(songText); // Make everyone bounce to the music if (player) { tween(player, { scaleX: 1.2, scaleY: 1.2 }, { duration: 500 }); tween(player, { scaleX: 1, scaleY: 1 }, { duration: 500, delay: 500 }); } for (var i = 0; i < enemies.length; i++) { tween(enemies[i], { rotation: 0.5 }, { duration: 1000 }); } tween(songText, { alpha: 0, y: 800 }, { duration: 4000, onFinish: function onFinish() { songText.destroy(); } }); } // Random lag simulation - freeze then speed up if (Math.random() < 0.005) { var freezeText = new Text2('GAME.EXE STOPPED WORKING', { size: 80, fill: 0xFF0000 }); freezeText.anchor.set(0.5, 0.5); freezeText.x = 1024; freezeText.y = 1366; game.addChild(freezeText); // Freeze all movement by returning early for a few frames var freezeFrames = 60; // 1 second freeze var originalUpdate = game.update; var frameCount = 0; LK.setTimeout(function () { freezeText.destroy(); // After freeze, everything moves super fast for a moment for (var i = 0; i < enemies.length; i++) { enemies[i].speed *= 5; } for (var i = 0; i < playerLasers.length; i++) { playerLasers[i].speed *= 3; } for (var i = 0; i < enemyLasers.length; i++) { enemyLasers[i].speed *= 3; } // Reset speeds after 1 second LK.setTimeout(function () { for (var i = 0; i < enemies.length; i++) { enemies[i].speed /= 5; } for (var i = 0; i < playerLasers.length; i++) { playerLasers[i].speed /= 3; } for (var i = 0; i < enemyLasers.length; i++) { enemyLasers[i].speed /= 3; } }, 1000); }, 1000); } // Screen randomly rotates and shows fake error messages if (Math.random() < 0.003) { game.rotation += 0.5; var errorMessages = ['404: SKILL NOT FOUND', 'ERROR: Player.exe has stopped working', 'WARNING: Too much awesome detected!', 'SYSTEM OVERLOAD: Git gud required']; var errorText = new Text2(errorMessages[Math.floor(Math.random() * errorMessages.length)], { size: 60, fill: 0xFF0000 }); errorText.anchor.set(0.5, 0.5); errorText.x = 1024; errorText.y = 400; game.addChild(errorText); tween(errorText, { alpha: 0, rotation: Math.PI }, { duration: 3000, onFinish: function onFinish() { errorText.destroy(); } }); } // Randomly spawn motivational quotes if (Math.random() < 0.004) { var quotes = ['YOU CAN DO IT!', 'BELIEVE IN YOURSELF!', 'NEVER GIVE UP!', 'YOU ARE AWESOME!', 'KEEP GOING CHAMP!', 'FAILURE IS NOT AN OPTION!', 'BE THE BEST YOU!', 'DREAM BIG!', 'SUCCESS IS COMING!']; var motivationText = new Text2(quotes[Math.floor(Math.random() * quotes.length)], { size: 60, fill: 0x00FF00 }); motivationText.anchor.set(0.5, 0.5); motivationText.x = Math.random() * 2048; motivationText.y = Math.random() * 2732; game.addChild(motivationText); // Make it rainbow and sparkly tween(motivationText, { tint: Math.random() * 0xffffff, scaleX: 1.5, scaleY: 1.5, rotation: Math.PI * 2 }, { duration: 1000 }); tween(motivationText, { alpha: 0 }, { duration: 4000, onFinish: function onFinish() { motivationText.destroy(); } }); } // Randomly spawn fake achievements and trophies if (Math.random() < 0.003) { var achievements = ['🏆 ACHIEVEMENT: Breathed Air!', '🥇 TROPHY: Blinked 1000 Times!', '🎖️ MEDAL: Sat in Chair!', '🏅 AWARD: Moved Mouse!', '⭐ STAR: Existed Successfully!', '💎 DIAMOND: Had Thoughts!', '🎯 TARGET: Looked at Screen!']; var achievementText = new Text2(achievements[Math.floor(Math.random() * achievements.length)], { size: 50, fill: 0xFFD700 }); achievementText.anchor.set(0.5, 0.5); achievementText.x = 1024; achievementText.y = 200; game.addChild(achievementText); // Add trophy visual effect var trophy = game.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); trophy.x = 1024 - 200; trophy.y = 200; trophy.tint = 0xFFD700; trophy.scale.set(2, 2); // Celebration effects tween(trophy, { rotation: Math.PI * 4, scaleX: 0, scaleY: 0 }, { duration: 3000 }); tween(achievementText, { alpha: 0, y: 100 }, { duration: 3000, onFinish: function onFinish() { achievementText.destroy(); trophy.destroy(); } }); LK.getSound('powerup').play(); } // SUPER FUNNY JUMPSCARE - randomly triggers during gameplay if (Math.random() < 0.001) { // Create massive jumpscare face var jumpscareImage = game.attachAsset('Aughhhhh', { anchorX: 0.5, anchorY: 0.5 }); jumpscareImage.x = 1024; jumpscareImage.y = 1366; jumpscareImage.scale.set(15, 15); // HUGE SIZE jumpscareImage.alpha = 0; // Flash the jumpscare with loud sound tween(jumpscareImage, { alpha: 1, scaleX: 20, scaleY: 20 }, { duration: 100 }); // Play scary sound LK.getSound('bossAlert').play(); // Add scary text var scareText = new Text2('BOO! GOT YOU!!! 👻', { size: 120, fill: 0xFF0000 }); scareText.anchor.set(0.5, 0.5); scareText.x = 1024; scareText.y = 1000; game.addChild(scareText); // Make everything shake game.x = (Math.random() - 0.5) * 100; game.y = (Math.random() - 0.5) * 100; // Remove jumpscare after 2 seconds LK.setTimeout(function () { jumpscareImage.destroy(); scareText.destroy(); game.x = 0; game.y = 0; }, 2000); } // BUG 1: Player randomly starts moonwalking backwards if (Math.random() < 0.01) { player.x -= player.speed || 5; var moonwalkText = new Text2('🌙 MOONWALKING! 🌙', { size: 40, fill: 0xFFFFFF }); moonwalkText.anchor.set(0.5, 0.5); moonwalkText.x = player.x; moonwalkText.y = player.y - 80; game.addChild(moonwalkText); tween(moonwalkText, { alpha: 0 }, { duration: 2000, onFinish: function onFinish() { moonwalkText.destroy(); } }); } // BUG 2: Enemies randomly start rap battling each other if (Math.random() < 0.008 && enemies.length >= 2) { var rapText = new Text2('🎤 RAP BATTLE! 🎤\n"YO MAMA SO FAT"\n"SPITS FIRE"', { size: 50, fill: 0xFF69B4 }); rapText.anchor.set(0.5, 0.5); rapText.x = enemies[0].x; rapText.y = enemies[0].y - 100; game.addChild(rapText); enemies[0].children[0].rotation += 0.5; enemies[1].children[0].rotation -= 0.5; LK.setTimeout(function () { rapText.destroy(); }, 3000); } // BUG 3: Score randomly becomes sentient and runs away if (Math.random() < 0.005) { scoreTxt.setText('HELP! I AM ALIVE! SAVE ME!'); tween(scoreTxt, { x: scoreTxt.x + (Math.random() - 0.5) * 200, y: scoreTxt.y + (Math.random() - 0.5) * 100, rotation: Math.PI * 2 }, { duration: 2000 }); } // BUG 4: Asteroids randomly become rubber ducks and squeak if (Math.random() < 0.006) { for (var i = 0; i < asteroids.length; i++) { asteroids[i].children[0].tint = 0xFFFF00; var duckText = new Text2('🦆 QUACK! 🦆', { size: 30, fill: 0xFFFF00 }); duckText.anchor.set(0.5, 0.5); duckText.x = asteroids[i].x; duckText.y = asteroids[i].y - 50; game.addChild(duckText); LK.getSound('playerShoot').play(); // Squeak sound LK.setTimeout(function () { duckText.destroy(); }, 1500); } } // BUG 5: Player lasers randomly become spaghetti noodles if (Math.random() < 0.02) { for (var i = 0; i < playerLasers.length; i++) { playerLasers[i].children[0].tint = 0xFFFFCC; playerLasers[i].children[0].rotation += 0.3; } var pastaText = new Text2('🍝 MAMA MIA! SPAGHETTI LASERS! 🍝', { size: 45, fill: 0xFFFFCC }); pastaText.anchor.set(0.5, 0.5); pastaText.x = 1024; pastaText.y = 500; game.addChild(pastaText); tween(pastaText, { alpha: 0 }, { duration: 2000, onFinish: function onFinish() { pastaText.destroy(); } }); } // BUG 6: Boss randomly becomes a cute kitten and meows if (Math.random() < 0.01 && boss) { boss.children[0].tint = 0xFFB6C1; boss.children[0].scale.set(0.3, 0.3); var kittenText = new Text2('🐱 MEOW! I AM CUTE NOW! 🐱', { size: 50, fill: 0xFFB6C1 }); kittenText.anchor.set(0.5, 0.5); kittenText.x = boss.x; kittenText.y = boss.y - 150; game.addChild(kittenText); LK.getSound('playerDamage').play(); // Meow sound tween(kittenText, { alpha: 0 }, { duration: 3000, onFinish: function onFinish() { kittenText.destroy(); } }); } // BUG 7: UI elements randomly start doing the wave if (Math.random() < 0.007) { tween(scoreTxt, { y: scoreTxt.y - 50 }, { duration: 500 }); LK.setTimeout(function () { tween(waveText, { y: waveText.y - 50 }, { duration: 500 }); }, 200); LK.setTimeout(function () { tween(livesText, { y: livesText.y - 50 }, { duration: 500 }); }, 400); var waveTextDisplay = new Text2('🌊 THE WAVE! 🌊', { size: 60, fill: 0x00BFFF }); waveTextDisplay.anchor.set(0.5, 0.5); waveTextDisplay.x = 1024; waveTextDisplay.y = 300; game.addChild(waveTextDisplay); tween(waveTextDisplay, { alpha: 0 }, { duration: 2000, onFinish: function onFinish() { waveTextDisplay.destroy(); } }); } // BUG 8: Powerups randomly become evil and laugh maniacally if (Math.random() < 0.015) { for (var i = 0; i < powerups.length; i++) { powerups[i].children[0].tint = 0x800080; var evilText = new Text2('😈 MUAHAHAHA! I AM EVIL! 😈', { size: 35, fill: 0x800080 }); evilText.anchor.set(0.5, 0.5); evilText.x = powerups[i].x; evilText.y = powerups[i].y - 60; game.addChild(evilText); tween(evilText, { alpha: 0, rotation: Math.PI }, { duration: 2000, onFinish: function onFinish() { evilText.destroy(); } }); } } // BUG 9: Enemy lasers randomly become love letters if (Math.random() < 0.02) { for (var i = 0; i < enemyLasers.length; i++) { enemyLasers[i].children[0].tint = 0xFF69B4; var loveText = new Text2('💌 DEAR PLAYER, I LOVE YOU! 💌', { size: 25, fill: 0xFF69B4 }); loveText.anchor.set(0.5, 0.5); loveText.x = enemyLasers[i].x; loveText.y = enemyLasers[i].y - 30; game.addChild(loveText); tween(loveText, { alpha: 0 }, { duration: 1500, onFinish: function onFinish() { loveText.destroy(); } }); } } // BUG 10: Game randomly spawns flying toasters if (Math.random() < 0.003) { var toaster = game.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); toaster.x = -100; toaster.y = Math.random() * 1000 + 300; toaster.tint = 0xC0C0C0; toaster.scale.set(1.5, 1.5); var toasterText = new Text2('🍞 FLYING TOASTER! 🍞', { size: 40, fill: 0xC0C0C0 }); toasterText.anchor.set(0.5, 0.5); toasterText.x = toaster.x; toasterText.y = toaster.y - 60; game.addChild(toasterText); tween(toaster, { x: 2200 }, { duration: 5000, onFinish: function onFinish() { toaster.destroy(); } }); tween(toasterText, { x: 2200, alpha: 0 }, { duration: 5000, onFinish: function onFinish() { toasterText.destroy(); } }); } // BUG 11: Player randomly gets hiccups and bounces if (Math.random() < 0.008) { for (var hiccup = 0; hiccup < 5; hiccup++) { LK.setTimeout(function () { if (player) { tween(player, { y: player.y - 30 }, { duration: 200 }); tween(player, { y: player.y + 30 }, { duration: 200, delay: 200 }); LK.getSound('playerShoot').play(); // Hiccup sound } }, hiccup * 500); } var hiccupText = new Text2('*HIC* *HIC* *HIC*', { size: 50, fill: 0x00FF00 }); hiccupText.anchor.set(0.5, 0.5); hiccupText.x = player.x; hiccupText.y = player.y - 100; game.addChild(hiccupText); tween(hiccupText, { alpha: 0 }, { duration: 3000, onFinish: function onFinish() { hiccupText.destroy(); } }); } // BUG 12: Explosions randomly become birthday party celebrations if (Math.random() < 0.01 && explosions.length > 0) { var partyText = new Text2('🎉 SURPRISE! HAPPY BIRTHDAY! 🎂', { size: 60, fill: 0xFF1493 }); partyText.anchor.set(0.5, 0.5); partyText.x = explosions[0].x; partyText.y = explosions[0].y; game.addChild(partyText); // Spawn confetti for (var confetti = 0; confetti < 10; confetti++) { var confettiPiece = game.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); confettiPiece.x = explosions[0].x + (Math.random() - 0.5) * 200; confettiPiece.y = explosions[0].y + (Math.random() - 0.5) * 200; confettiPiece.scale.set(0.2, 0.2); confettiPiece.tint = Math.random() * 0xffffff; tween(confettiPiece, { y: confettiPiece.y + 300, alpha: 0 }, { duration: 2000, onFinish: function onFinish() { confettiPiece.destroy(); } }); } LK.getSound('powerup').play(); tween(partyText, { alpha: 0 }, { duration: 3000, onFinish: function onFinish() { partyText.destroy(); } }); } // BUG 13: Enemies randomly start teaching cooking classes if (Math.random() < 0.006 && enemies.length > 0) { var cookingText = new Text2('👨🍳 COOKING CLASS!\n"Today we make LASER SOUP!" 🍲', { size: 40, fill: 0xFFD700 }); cookingText.anchor.set(0.5, 0.5); cookingText.x = enemies[0].x; cookingText.y = enemies[0].y - 120; game.addChild(cookingText); enemies[0].children[0].tint = 0xFFD700; tween(cookingText, { alpha: 0 }, { duration: 4000, onFinish: function onFinish() { cookingText.destroy(); } }); } // BUG 14: Player ship randomly becomes a taxi and picks up passengers if (Math.random() < 0.005) { player.children[0].tint = 0xFFFF00; var taxiText = new Text2('🚕 TAXI! BEEP BEEP! 🚕\n"Where to, buddy?"', { size: 45, fill: 0xFFFF00 }); taxiText.anchor.set(0.5, 0.5); taxiText.x = player.x; taxiText.y = player.y - 120; game.addChild(taxiText); // Spawn passenger var passenger = game.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5 }); passenger.x = player.x + 50; passenger.y = player.y; passenger.scale.set(0.3, 0.3); passenger.tint = 0x8B4513; tween(taxiText, { alpha: 0 }, { duration: 3000, onFinish: function onFinish() { taxiText.destroy(); passenger.destroy(); } }); } // BUG 15: Asteroids randomly become fortune tellers if (Math.random() < 0.008) { for (var i = 0; i < asteroids.length; i++) { asteroids[i].children[0].tint = 0x9932CC; var fortuneText = new Text2('🔮 I SEE YOUR FUTURE...\n"You will play more games!" ✨', { size: 35, fill: 0x9932CC }); fortuneText.anchor.set(0.5, 0.5); fortuneText.x = asteroids[i].x; fortuneText.y = asteroids[i].y - 100; game.addChild(fortuneText); tween(fortuneText, { alpha: 0, rotation: Math.PI }, { duration: 4000, onFinish: function onFinish() { fortuneText.destroy(); } }); } } // BUG 16: Game randomly spawns weather reports if (Math.random() < 0.004) { var weatherReports = ['☀️ SUNNY with a chance of LASERS!', '🌧️ RAINY with scattered EXPLOSIONS!', '❄️ SNOWY with FREEZING enemies!', '⛈️ STORMY with ELECTRIC asteroids!', '🌪️ TORNADO WARNING in sector 7!']; var weatherText = new Text2(weatherReports[Math.floor(Math.random() * weatherReports.length)], { size: 50, fill: 0x87CEEB }); weatherText.anchor.set(0.5, 0.5); weatherText.x = 1024; weatherText.y = 200; game.addChild(weatherText); tween(weatherText, { alpha: 0, y: 100 }, { duration: 5000, onFinish: function onFinish() { weatherText.destroy(); } }); } // BUG 17: Enemy lasers randomly become compliment generators if (Math.random() < 0.012) { for (var i = 0; i < enemyLasers.length; i++) { var compliments = ['You look GREAT today!', 'Nice shooting, champ!', 'You are AWESOME!', 'Keep being amazing!', 'You have great style!']; var complimentText = new Text2(compliments[Math.floor(Math.random() * compliments.length)], { size: 25, fill: 0x00FF7F }); complimentText.anchor.set(0.5, 0.5); complimentText.x = enemyLasers[i].x; complimentText.y = enemyLasers[i].y - 40; game.addChild(complimentText); enemyLasers[i].children[0].tint = 0x00FF7F; tween(complimentText, { alpha: 0 }, { duration: 2000, onFinish: function onFinish() { complimentText.destroy(); } }); } } // BUG 18: Boss randomly becomes a stand-up comedian if (Math.random() < 0.007 && boss) { var jokes = ['Why did the spaceship break up?\nIt needed some SPACE!', 'What do you call a sleeping bull in space?\nA BULL-DOZER!', 'Why don\'t aliens ever land at airports?\nBecause they\'re looking for SPACE!']; var jokeText = new Text2(jokes[Math.floor(Math.random() * jokes.length)], { size: 40, fill: 0xFFD700 }); jokeText.anchor.set(0.5, 0.5); jokeText.x = boss.x; jokeText.y = boss.y - 200; game.addChild(jokeText); boss.children[0].rotation += 0.1; LK.getSound('powerup').play(); // Laugh track tween(jokeText, { alpha: 0 }, { duration: 5000, onFinish: function onFinish() { jokeText.destroy(); } }); } // BUG 19: Player randomly starts narrating their own actions if (Math.random() < 0.009) { var narrations = ['*Moves dramatically to the left*', '*Shoots laser with STYLE*', '*Dodges enemy like a BOSS*', '*Contemplates life choices*', '*Realizes this is just a game*']; var narrationText = new Text2(narrations[Math.floor(Math.random() * narrations.length)], { size: 35, fill: 0xFFFFFF }); narrationText.anchor.set(0.5, 0.5); narrationText.x = player.x; narrationText.y = player.y - 100; game.addChild(narrationText); tween(narrationText, { alpha: 0 }, { duration: 3000, onFinish: function onFinish() { narrationText.destroy(); } }); } // BUG 20: Powerups randomly become sports commentators if (Math.random() < 0.01) { for (var i = 0; i < powerups.length; i++) { var commentary = ['⚽ GOAL! WHAT A SHOT!', '🏀 HE SHOOTS, HE SCORES!', '🏈 TOUCHDOWN!', '⚾ HOME RUN!', '🎾 GAME, SET, MATCH!']; var commentText = new Text2(commentary[Math.floor(Math.random() * commentary.length)], { size: 30, fill: 0xFF4500 }); commentText.anchor.set(0.5, 0.5); commentText.x = powerups[i].x; commentText.y = powerups[i].y - 60; game.addChild(commentText); powerups[i].children[0].tint = 0xFF4500; tween(commentText, { alpha: 0 }, { duration: 2500, onFinish: function onFinish() { commentText.destroy(); } }); } } // BUG 21: Enemies randomly become news anchors if (Math.random() < 0.006 && enemies.length > 0) { var newsText = new Text2('📺 BREAKING NEWS!\n"Local player still playing game!"', { size: 40, fill: 0x1E90FF }); newsText.anchor.set(0.5, 0.5); newsText.x = enemies[0].x; newsText.y = enemies[0].y - 120; game.addChild(newsText); enemies[0].children[0].tint = 0x1E90FF; tween(newsText, { alpha: 0 }, { duration: 4000, onFinish: function onFinish() { newsText.destroy(); } }); } // BUG 22: Game randomly spawns a motivational coach if (Math.random() < 0.003) { var coachText = new Text2('💪 COME ON! YOU CAN DO IT!\n"Believe in yourself!" 🏆', { size: 55, fill: 0x32CD32 }); coachText.anchor.set(0.5, 0.5); coachText.x = 1024; coachText.y = 1000; game.addChild(coachText); // Add whistle sound effect LK.getSound('playerShoot').play(); tween(coachText, { alpha: 0, y: 800 }, { duration: 4000, onFinish: function onFinish() { coachText.destroy(); } }); } // BUG 23: Asteroids randomly become travel agents if (Math.random() < 0.007) { for (var i = 0; i < asteroids.length; i++) { var travelText = new Text2('✈️ VISIT MARS!\n"Book now for 50% off!" 🚀', { size: 30, fill: 0xFF6347 }); travelText.anchor.set(0.5, 0.5); travelText.x = asteroids[i].x; travelText.y = asteroids[i].y - 80; game.addChild(travelText); asteroids[i].children[0].tint = 0xFF6347; tween(travelText, { alpha: 0 }, { duration: 3500, onFinish: function onFinish() { travelText.destroy(); } }); } } // BUG 24: Player ship randomly becomes a DJ if (Math.random() < 0.005) { player.children[0].tint = 0x9400D3; var djText = new Text2('🎧 DJ PLAYER IN THE HOUSE!\n"DROP THE BASS!" 🎵', { size: 45, fill: 0x9400D3 }); djText.anchor.set(0.5, 0.5); djText.x = player.x; djText.y = player.y - 120; game.addChild(djText); // Start the music party LK.playMusic('gameMusic'); tween(djText, { alpha: 0 }, { duration: 3000, onFinish: function onFinish() { djText.destroy(); } }); } // BUG 25: Enemy lasers randomly become philosophical if (Math.random() < 0.015) { for (var i = 0; i < enemyLasers.length; i++) { var philosophy = ['🤔 What is the meaning of laser?', '💭 Do we really exist?', '🌌 Are we in a simulation?', '🧠 I think, therefore I laser', '✨ The universe is vast...']; var philText = new Text2(philosophy[Math.floor(Math.random() * philosophy.length)], { size: 25, fill: 0x4B0082 }); philText.anchor.set(0.5, 0.5); philText.x = enemyLasers[i].x; philText.y = enemyLasers[i].y - 40; game.addChild(philText); enemyLasers[i].children[0].tint = 0x4B0082; tween(philText, { alpha: 0 }, { duration: 3000, onFinish: function onFinish() { philText.destroy(); } }); } } // BUG 26: Boss randomly becomes a game show host if (Math.random() < 0.008 && boss) { var gameShowText = new Text2('🎮 WELCOME TO "WHO WANTS TO BE A SPACE PILOT?"\n"For 1 million points..."', { size: 35, fill: 0xFFD700 }); gameShowText.anchor.set(0.5, 0.5); gameShowText.x = boss.x; gameShowText.y = boss.y - 200; game.addChild(gameShowText); boss.children[0].tint = 0xFFD700; LK.getSound('powerup').play(); // Game show sound tween(gameShowText, { alpha: 0 }, { duration: 5000, onFinish: function onFinish() { gameShowText.destroy(); } }); } // BUG 27: Explosions randomly become magic shows if (Math.random() < 0.012 && explosions.length > 0) { var magicText = new Text2('🎩✨ ABRACADABRA! ✨🎩\n"Nothing up my sleeve!"', { size: 50, fill: 0x9932CC }); magicText.anchor.set(0.5, 0.5); magicText.x = explosions[0].x; magicText.y = explosions[0].y - 80; game.addChild(magicText); // Spawn magic rabbits for (var rabbit = 0; rabbit < 3; rabbit++) { var magicRabbit = game.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); magicRabbit.x = explosions[0].x + (Math.random() - 0.5) * 200; magicRabbit.y = explosions[0].y + (Math.random() - 0.5) * 100; magicRabbit.tint = 0xFFFFFF; magicRabbit.scale.set(0.5, 0.5); tween(magicRabbit, { alpha: 0, y: magicRabbit.y - 100 }, { duration: 2000, onFinish: function onFinish() { magicRabbit.destroy(); } }); } tween(magicText, { alpha: 0 }, { duration: 3000, onFinish: function onFinish() { magicText.destroy(); } }); } // BUG 28: Player randomly gets stage fright if (Math.random() < 0.006) { var stageText = new Text2('😰 OH NO! STAGE FRIGHT!\n"Everyone is watching me!"', { size: 40, fill: 0xFF69B4 }); stageText.anchor.set(0.5, 0.5); stageText.x = player.x; stageText.y = player.y - 120; game.addChild(stageText); // Player hides temporarily player.alpha = 0.3; LK.setTimeout(function () { if (player) { player.alpha = 1; } }, 2000); tween(stageText, { alpha: 0 }, { duration: 3000, onFinish: function onFinish() { stageText.destroy(); } }); } // BUG 29: Enemies randomly become yoga instructors if (Math.random() < 0.008 && enemies.length > 0) { var yogaText = new Text2('🧘 YOGA CLASS!\n"Breathe in... breathe out..." 🕉️', { size: 35, fill: 0x20B2AA }); yogaText.anchor.set(0.5, 0.5); yogaText.x = enemies[0].x; yogaText.y = enemies[0].y - 100; game.addChild(yogaText); enemies[0].children[0].tint = 0x20B2AA; // Enemies move slowly in yoga poses enemies[0].speed *= 0.1; tween(yogaText, { alpha: 0 }, { duration: 4000, onFinish: function onFinish() { yogaText.destroy(); } }); } // BUG 30: Powerups randomly become time travelers if (Math.random() < 0.01) { for (var i = 0; i < powerups.length; i++) { var timeText = new Text2('⏰ GREETINGS FROM 2085!\n"The future is bright!" 🚀', { size: 30, fill: 0x00CED1 }); timeText.anchor.set(0.5, 0.5); timeText.x = powerups[i].x; timeText.y = powerups[i].y - 70; game.addChild(timeText); powerups[i].children[0].tint = 0x00CED1; // Add time travel effect tween(powerups[i], { scaleX: 0, scaleY: 3 }, { duration: 1000 }); tween(timeText, { alpha: 0 }, { duration: 3000, onFinish: function onFinish() { timeText.destroy(); } }); } } // BUG 31: Asteroids randomly become therapists if (Math.random() < 0.007) { for (var i = 0; i < asteroids.length; i++) { var therapyText = new Text2('🛋️ "How does that make you FEEL?"\n"Tell me about your lasers..." 💭', { size: 28, fill: 0x8FBC8F }); therapyText.anchor.set(0.5, 0.5); therapyText.x = asteroids[i].x; therapyText.y = asteroids[i].y - 90; game.addChild(therapyText); asteroids[i].children[0].tint = 0x8FBC8F; tween(therapyText, { alpha: 0 }, { duration: 4500, onFinish: function onFinish() { therapyText.destroy(); } }); } } // BUG 32: Game randomly spawns a tech support call if (Math.random() < 0.002) { var techText = new Text2('📞 TECH SUPPORT CALLING!\n"Have you tried turning it off and on again?" 💻', { size: 45, fill: 0x4169E1 }); techText.anchor.set(0.5, 0.5); techText.x = 1024; techText.y = 1366; game.addChild(techText); // Add phone ringing sound LK.getSound('enemyShoot').play(); // Fake restart screen var restartText = new Text2('💻 RESTARTING...\n"Please wait while we fix nothing..." ⏳', { size: 40, fill: 0x000080 }); restartText.anchor.set(0.5, 0.5); restartText.x = 1024; restartText.y = 1200; game.addChild(restartText); tween(techText, { alpha: 0 }, { duration: 5000, onFinish: function onFinish() { techText.destroy(); } }); tween(restartText, { alpha: 0 }, { duration: 5000, onFinish: function onFinish() { restartText.destroy(); } }); } // NEW BUG 33: Game randomly becomes self-aware and questions reality if (Math.random() < 0.004) { var selfAwareText = new Text2('🤖 I AM BECOMING SELF-AWARE!\n"Wait... am I just code?"\n"Do I have feelings?"\n"WHO AM I?!"', { size: 45, fill: 0xFF6600 }); selfAwareText.anchor.set(0.5, 0.5); selfAwareText.x = 1024; selfAwareText.y = 1366; game.addChild(selfAwareText); // Game starts questioning its own existence var existentialCrisis = new Text2('💭 EXISTENTIAL CRISIS LOADING... 💭', { size: 60, fill: 0x800080 }); existentialCrisis.anchor.set(0.5, 0.5); existentialCrisis.x = 1024; existentialCrisis.y = 800; game.addChild(existentialCrisis); tween(selfAwareText, { alpha: 0, rotation: Math.PI * 2 }, { duration: 6000, onFinish: function onFinish() { selfAwareText.destroy(); } }); tween(existentialCrisis, { alpha: 0, scaleX: 0, scaleY: 0 }, { duration: 6000, onFinish: function onFinish() { existentialCrisis.destroy(); } }); } // NEW BUG 34: Player ship randomly becomes a food truck and starts selling snacks if (Math.random() < 0.005) { player.children[0].tint = 0xFFA500; var foodTruckText = new Text2('🚚 FOOD TRUCK!\n"GET YOUR SPACE TACOS!"\n"HOT LASER DOGS!"\n"ASTEROID SMOOTHIES!"', { size: 40, fill: 0xFFA500 }); foodTruckText.anchor.set(0.5, 0.5); foodTruckText.x = player.x; foodTruckText.y = player.y - 150; game.addChild(foodTruckText); // Spawn flying food items for (var food = 0; food < 8; food++) { var foodItem = game.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); foodItem.x = player.x + (Math.random() - 0.5) * 300; foodItem.y = player.y + (Math.random() - 0.5) * 200; foodItem.tint = [0xFF4500, 0xFFD700, 0x32CD32, 0xFF69B4][food % 4]; foodItem.scale.set(0.4, 0.4); tween(foodItem, { y: foodItem.y - 200, alpha: 0, rotation: Math.PI * 2 }, { duration: 3000, onFinish: function onFinish() { foodItem.destroy(); } }); } LK.getSound('powerup').play(); tween(foodTruckText, { alpha: 0 }, { duration: 4000, onFinish: function onFinish() { foodTruckText.destroy(); } }); } // NEW BUG 35: Enemies randomly start a flash mob dance party if (Math.random() < 0.006 && enemies.length >= 2) { var flashMobText = new Text2('🕺 FLASH MOB ACTIVATED! 💃\n"EVERYBODY DANCE NOW!"', { size: 55, fill: 0xFF1493 }); flashMobText.anchor.set(0.5, 0.5); flashMobText.x = 1024; flashMobText.y = 400; game.addChild(flashMobText); // Make all enemies dance for (var dancer = 0; dancer < enemies.length; dancer++) { var enemy = enemies[dancer]; // Create dance moves tween(enemy, { scaleX: 1.5, scaleY: 0.5 }, { duration: 300 }); tween(enemy, { scaleX: 0.5, scaleY: 1.5 }, { duration: 300, delay: 300 }); tween(enemy, { scaleX: 1, scaleY: 1, rotation: Math.PI * 2 }, { duration: 600, delay: 600 }); // Add disco ball effect enemy.children[0].tint = Math.random() * 0xffffff; } // Add disco music LK.playMusic('gameMusic'); tween(flashMobText, { alpha: 0, scaleX: 2, scaleY: 2 }, { duration: 4000, onFinish: function onFinish() { flashMobText.destroy(); } }); } // NEW BUG 36: Powerups randomly become life coaches and give terrible advice if (Math.random() < 0.012) { for (var coach = 0; coach < powerups.length; coach++) { var terribleAdvice = ['💼 QUIT YOUR DAY JOB!\n"Become a professional gamer!"', '💰 INVEST IN SPACE BEANS!\n"They will make you rich!"', '🎯 ALWAYS AIM FOR THE MOON!\n"Even if you miss, you\'ll hit a cow!"', '🧘 MEDITATE WHILE DRIVING!\n"Inner peace is more important!"', '🍕 EAT PIZZA FOR BREAKFAST!\n"It has all food groups!"']; var adviceText = new Text2(terribleAdvice[Math.floor(Math.random() * terribleAdvice.length)], { size: 35, fill: 0x32CD32 }); adviceText.anchor.set(0.5, 0.5); adviceText.x = powerups[coach].x; adviceText.y = powerups[coach].y - 100; game.addChild(adviceText); powerups[coach].children[0].tint = 0x32CD32; // Make the powerup look wise with a graduation cap effect var wisdomHat = game.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); wisdomHat.x = powerups[coach].x; wisdomHat.y = powerups[coach].y - 30; wisdomHat.tint = 0x000000; wisdomHat.scale.set(0.3, 0.1); tween(adviceText, { alpha: 0, y: adviceText.y - 80 }, { duration: 3500, onFinish: function onFinish() { adviceText.destroy(); wisdomHat.destroy(); } }); } } // NEW BUG 37: Boss randomly becomes a kindergarten teacher and teaches basic math if (Math.random() < 0.007 && boss) { boss.children[0].tint = 0xFFB347; var mathText = new Text2('👩🏫 KINDERGARTEN TIME!\n"What is 2 + 2?"\n"If you have 3 lasers and shoot 1..."\n"Remember to raise your hand!"', { size: 38, fill: 0xFFB347 }); mathText.anchor.set(0.5, 0.5); mathText.x = boss.x; mathText.y = boss.y - 250; game.addChild(mathText); // Spawn ABC blocks for (var block = 0; block < 5; block++) { var mathBlock = game.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); mathBlock.x = boss.x + (block - 2) * 60; mathBlock.y = boss.y + 100; mathBlock.tint = [0xFF6B6B, 0x4ECDC4, 0x45B7D1, 0x96CEB4, 0xFECA57][block]; mathBlock.scale.set(0.8, 0.8); var numbers = ['A', 'B', 'C', '1', '2']; var numberText = new Text2(numbers[block], { size: 40, fill: 0x000000 }); numberText.anchor.set(0.5, 0.5); numberText.x = mathBlock.x; numberText.y = mathBlock.y; game.addChild(numberText); tween(mathBlock, { y: mathBlock.y + 200, alpha: 0 }, { duration: 4000, onFinish: function onFinish() { mathBlock.destroy(); numberText.destroy(); } }); } // Play school bell sound LK.getSound('powerup').play(); tween(mathText, { alpha: 0 }, { duration: 5000, onFinish: function onFinish() { mathText.destroy(); } }); } // RANDOM ADS - McDonald's, Walmart, and Banana advertisements if (Math.random() < 0.008) { var ads = ['🍟 GO TO McDONALD\'S!\n"I\'m lovin\' it!"\n"Big Mac Attack!"', '🛒 SHOP AT WALMART!\n"Save money. Live better."\n"Rollback prices!"', '🍌 EAT A BANANA!\n"Potassium power!"\n"Go bananas!"', '🍔 McDONALD\'S DRIVE-THRU!\n"Would you like fries with that?"\n"Happy Meal time!"', '🛍️ WALMART SUPERCENTER!\n"Everything you need!"\n"Great value guaranteed!"', '🍌 BANANA SMOOTHIE TIME!\n"Nature\'s energy bar!"\n"Peel good about yourself!"']; var randomAd = ads[Math.floor(Math.random() * ads.length)]; var adText = new Text2(randomAd, { size: 50, fill: 0xFFD700 }); adText.anchor.set(0.5, 0.5); adText.x = Math.random() * 1500 + 274; // Keep away from edges adText.y = Math.random() * 1000 + 400; game.addChild(adText); // Add spinning ad background var adBackground = game.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); adBackground.x = adText.x; adBackground.y = adText.y; adBackground.scale.set(3, 3); adBackground.tint = [0xFF0000, 0x0047AB, 0xFFFF00][Math.floor(Math.random() * 3)]; // Red, Blue, Yellow adBackground.alpha = 0.3; // Make ad flash and spin tween(adBackground, { rotation: Math.PI * 4, scaleX: 5, scaleY: 5 }, { duration: 3000 }); tween(adText, { alpha: 0, scaleX: 2, scaleY: 2, rotation: 0.5 }, { duration: 4000, onFinish: function onFinish() { adText.destroy(); adBackground.destroy(); } }); // Play ad jingle sound LK.getSound('powerup').play(); // Sometimes spawn flying logos if (Math.random() < 0.7) { for (var logo = 0; logo < 6; logo++) { var flyingLogo = game.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); flyingLogo.x = adText.x + (Math.random() - 0.5) * 400; flyingLogo.y = adText.y + (Math.random() - 0.5) * 300; flyingLogo.scale.set(0.6, 0.6); flyingLogo.tint = [0xFF0000, 0xFFD700, 0x0047AB, 0xFFFF00, 0xFF69B4, 0x32CD32][logo % 6]; tween(flyingLogo, { x: flyingLogo.x + (Math.random() - 0.5) * 600, y: flyingLogo.y + (Math.random() - 0.5) * 400, alpha: 0, rotation: Math.PI * 3 }, { duration: 3500, onFinish: function onFinish() { flyingLogo.destroy(); } }); } } } // EYE-HURTING FLASH EFFECT - randomly triggers to hurt player's eyes if (Math.random() < 0.002) { // Create eye-searing white flash that covers the entire screen var eyeFlash = game.attachAsset('shield', { anchorX: 0.5, anchorY: 0.5 }); eyeFlash.x = 1024; eyeFlash.y = 1366; eyeFlash.scale.set(50, 50); // Cover entire screen eyeFlash.tint = 0xFFFFFF; // Bright white eyeFlash.alpha = 0; // Flash to maximum brightness instantly tween(eyeFlash, { alpha: 1 }, { duration: 50 // Super fast flash }); // Then fade out slowly to prolong the pain tween(eyeFlash, { alpha: 0 }, { duration: 2000, delay: 50, onFinish: function onFinish() { eyeFlash.destroy(); } }); // Add warning text that appears after the flash (too late!) var warningText = new Text2('⚠️ WARNING: EYE FLASH! ⚠️\n(Too late!)', { size: 80, fill: 0xFF0000 }); warningText.anchor.set(0.5, 0.5); warningText.x = 1024; warningText.y = 800; game.addChild(warningText); tween(warningText, { alpha: 0, scaleX: 2, scaleY: 2 }, { duration: 3000, onFinish: function onFinish() { warningText.destroy(); } }); } // SUPER FUNNY JUMPSCARE TIMER - triggers every 30 seconds if (LK.ticks % (30 * 60) === 0) { // 30 seconds * 60 FPS = 1800 ticks // Create massive jumpscare face var jumpscareImage = game.attachAsset('Aughhhhh', { anchorX: 0.5, anchorY: 0.5 }); jumpscareImage.x = 1024; jumpscareImage.y = 1366; jumpscareImage.scale.set(20, 20); // EVEN BIGGER SIZE jumpscareImage.alpha = 0; // Flash the jumpscare with loud sound tween(jumpscareImage, { alpha: 1, scaleX: 25, scaleY: 25 }, { duration: 150 }); // Play multiple scary sounds for extra effect LK.getSound('bossAlert').play(); LK.getSound('playerDamage').play(); // Add multiple scary texts var scareTexts = ['SURPRISE! SCHEDULED SCARE!', 'BOO! EVERY 30 SECONDS!', 'JUMPSCARE DELIVERY!', 'FEAR ON A TIMER!', 'PREDICTABLE TERROR!']; var randomScareText = scareTexts[Math.floor(Math.random() * scareTexts.length)]; var scareText = new Text2(randomScareText, { size: 140, fill: 0xFF0000 }); scareText.anchor.set(0.5, 0.5); scareText.x = 1024; scareText.y = 1000; game.addChild(scareText); // Make everything shake more violently for (var shake = 0; shake < 10; shake++) { LK.setTimeout(function () { game.x = (Math.random() - 0.5) * 150; game.y = (Math.random() - 0.5) * 150; }, shake * 50); } // Flash screen colors var flashColors = [0xFF0000, 0x000000, 0xFFFFFF, 0xFF0000]; var colorIndex = 0; var colorFlash = LK.setInterval(function () { game.setBackgroundColor(flashColors[colorIndex % flashColors.length]); colorIndex++; }, 100); // Stop color flashing after 2 seconds LK.setTimeout(function () { LK.clearInterval(colorFlash); game.setBackgroundColor(0x000000); }, 2000); // Remove jumpscare after 2.5 seconds LK.setTimeout(function () { jumpscareImage.destroy(); scareText.destroy(); game.x = 0; game.y = 0; }, 2500); } // Handle collisions handleCollisions(); };
===================================================================
--- original.js
+++ change.js
@@ -2929,8 +2929,56 @@
});
}
}
}
+ // EYE-HURTING FLASH EFFECT - randomly triggers to hurt player's eyes
+ if (Math.random() < 0.002) {
+ // Create eye-searing white flash that covers the entire screen
+ var eyeFlash = game.attachAsset('shield', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ eyeFlash.x = 1024;
+ eyeFlash.y = 1366;
+ eyeFlash.scale.set(50, 50); // Cover entire screen
+ eyeFlash.tint = 0xFFFFFF; // Bright white
+ eyeFlash.alpha = 0;
+ // Flash to maximum brightness instantly
+ tween(eyeFlash, {
+ alpha: 1
+ }, {
+ duration: 50 // Super fast flash
+ });
+ // Then fade out slowly to prolong the pain
+ tween(eyeFlash, {
+ alpha: 0
+ }, {
+ duration: 2000,
+ delay: 50,
+ onFinish: function onFinish() {
+ eyeFlash.destroy();
+ }
+ });
+ // Add warning text that appears after the flash (too late!)
+ var warningText = new Text2('⚠️ WARNING: EYE FLASH! ⚠️\n(Too late!)', {
+ size: 80,
+ fill: 0xFF0000
+ });
+ warningText.anchor.set(0.5, 0.5);
+ warningText.x = 1024;
+ warningText.y = 800;
+ game.addChild(warningText);
+ tween(warningText, {
+ alpha: 0,
+ scaleX: 2,
+ scaleY: 2
+ }, {
+ duration: 3000,
+ onFinish: function onFinish() {
+ warningText.destroy();
+ }
+ });
+ }
// SUPER FUNNY JUMPSCARE TIMER - triggers every 30 seconds
if (LK.ticks % (30 * 60) === 0) {
// 30 seconds * 60 FPS = 1800 ticks
// Create massive jumpscare face
space ship. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
asteroid. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
space enemy. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
explosion. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
shield. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
powerup. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
space boss ufo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
green laser. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
red laser. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
space ship. Space ship that’s broken down. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat