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; } }); return self.health <= 0; }; self.update = function () { self.y += self.speed.y; self.x += self.speed.x; asteroid.rotation += self.rotation; // Randomly become soap bubble if (Math.random() < 0.02) { asteroid.tint = 0x87CEEB; asteroid.alpha = 0.3; var bubbleText = new Text2('🫧', { size: 50, fill: 0x00BFFF }); bubbleText.anchor.set(0.5, 0.5); bubbleText.x = self.x; bubbleText.y = self.y; self.parent.addChild(bubbleText); // Bubble floats upward self.speed.y = -1; self.speed.x = Math.sin(Date.now() * 0.001) * 2; LK.setTimeout(function () { if (bubbleText.parent) bubbleText.destroy(); asteroid.tint = 0x95a5a6; asteroid.alpha = 1; }, 4000); } // Randomly become space taco if (Math.random() < 0.03) { asteroid.tint = 0xDAA520; var tacoText = new Text2('🌮 SPACE TACO! 🌮', { size: 40, fill: 0xFF4500 }); tacoText.anchor.set(0.5, 0.5); tacoText.x = self.x; tacoText.y = self.y - 70; self.parent.addChild(tacoText); // Spawn taco ingredients var ingredients = ['🥬', '🍅', '🧀', '🥩', '🌶️']; for (var i = 0; i < 3; i++) { var ingredient = new Text2(ingredients[Math.floor(Math.random() * ingredients.length)], { size: 20, fill: 0xFFFFFF }); ingredient.anchor.set(0.5, 0.5); ingredient.x = self.x + (Math.random() - 0.5) * 80; ingredient.y = self.y + (Math.random() - 0.5) * 80; self.parent.addChild(ingredient); tween(ingredient, { alpha: 0, y: ingredient.y + 100 }, { duration: 2500, onFinish: function onFinish() { ingredient.destroy(); } }); } LK.setTimeout(function () { tacoText.destroy(); asteroid.tint = 0x95a5a6; }, 3000); } // Randomly become invisible/visible if (Math.random() < 0.05) { asteroid.alpha = asteroid.alpha > 0.5 ? 0.1 : 1; } // Randomly start disco dancing if (Math.random() < 0.003) { asteroid.tint = 0xFF1493; var discoText = new Text2('🕺 DISCO FEVER! 🕺', { size: 40, fill: 0x00FFFF }); discoText.anchor.set(0.5, 0.5); discoText.x = self.x; discoText.y = self.y - 100; self.parent.addChild(discoText); // Make asteroid dance for (var d = 0; d < 10; d++) { LK.setTimeout(function () { asteroid.rotation += Math.PI / 4; asteroid.scaleX = 1 + Math.sin(Date.now() * 0.01) * 0.5; asteroid.scaleY = 1 + Math.cos(Date.now() * 0.01) * 0.5; }, d * 200); } LK.setTimeout(function () { discoText.destroy(); asteroid.tint = 0x95a5a6; }, 2000); } }; 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 transform into giant pizza if (Math.random() < 0.002) { ship.tint = 0xFFD700; var pizzaText = new Text2('🍕 I AM PIZZA BOSS NOW! 🍕', { size: 80, fill: 0xFF4500 }); pizzaText.anchor.set(0.5, 0.5); pizzaText.x = self.x; pizzaText.y = self.y - 200; self.parent.addChild(pizzaText); ship.rotation += 0.2; LK.setTimeout(function () { pizzaText.destroy(); ship.tint = self.level > 1 ? 0xcc00cc : 0x9b59b6; }, 3000); } // Randomly become motivational speaker if (Math.random() < 0.003) { var motivationalQuotes = ['BELIEVE IN YOURSELF!', 'YOU CAN DO IT!', 'NEVER GIVE UP!', 'FOLLOW YOUR DREAMS!', 'BE THE CHANGE!']; var motivText = new Text2('📢 ' + motivationalQuotes[Math.floor(Math.random() * motivationalQuotes.length)], { size: 70, fill: 0x32CD32 }); motivText.anchor.set(0.5, 0.5); motivText.x = self.x; motivText.y = self.y - 180; self.parent.addChild(motivText); // Add sparkles for (var s = 0; s < 8; s++) { var sparkle = new Text2('✨', { size: 25, fill: 0xFFD700 }); sparkle.anchor.set(0.5, 0.5); sparkle.x = self.x + (Math.random() - 0.5) * 300; sparkle.y = self.y + (Math.random() - 0.5) * 200; self.parent.addChild(sparkle); tween(sparkle, { alpha: 0, rotation: Math.PI * 2 }, { duration: 3000, onFinish: function onFinish() { sparkle.destroy(); } }); } LK.setTimeout(function () { motivText.destroy(); }, 3500); } // Randomly become giant rubber duck if (Math.random() < 0.001) { ship.tint = 0xFFFF00; var duckText = new Text2('🦆 QUACK QUACK I AM DUCK BOSS! 🦆', { size: 90, fill: 0xFF8C00 }); duckText.anchor.set(0.5, 0.5); duckText.x = self.x; duckText.y = self.y - 250; self.parent.addChild(duckText); // Make boss bounce like a rubber duck var bounceCount = 0; var bounceInterval = LK.setInterval(function () { ship.y += Math.sin(bounceCount * 0.3) * 5; ship.rotation = Math.sin(bounceCount * 0.2) * 0.2; bounceCount++; }, 100); // Spawn rubber duck sounds var quackInterval = LK.setInterval(function () { var quackText = new Text2('QUACK!', { size: 40, fill: 0xFFFF00 }); quackText.anchor.set(0.5, 0.5); quackText.x = self.x + (Math.random() - 0.5) * 200; quackText.y = self.y + (Math.random() - 0.5) * 150; self.parent.addChild(quackText); tween(quackText, { alpha: 0, y: quackText.y - 50 }, { duration: 1000, onFinish: function onFinish() { quackText.destroy(); } }); }, 800); LK.setTimeout(function () { LK.clearInterval(bounceInterval); LK.clearInterval(quackInterval); duckText.destroy(); ship.tint = self.level > 1 ? 0xcc00cc : 0x9b59b6; ship.rotation = 0; }, 5000); } }; 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 quote Shakespeare if (Math.random() < 0.01) { var quotes = ['To be or not to be', 'Et tu, Brute?', 'All the world\'s a stage', 'Something wicked this way comes', 'Double, double toil and trouble']; var shakespeareText = new Text2(quotes[Math.floor(Math.random() * quotes.length)], { size: 25, fill: 0xFF69B4 }); shakespeareText.anchor.set(0.5, 0.5); shakespeareText.x = self.x; shakespeareText.y = self.y - 50; self.parent.addChild(shakespeareText); tween(shakespeareText, { alpha: 0, y: shakespeareText.y - 100 }, { duration: 3000, onFinish: function onFinish() { shakespeareText.destroy(); } }); } // 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 crying if (Math.random() < 0.015) { var cryText = new Text2('😭 WHY AM I HERE?! 😭', { size: 35, fill: 0x1E90FF }); cryText.anchor.set(0.5, 0.5); cryText.x = self.x; cryText.y = self.y - 60; self.parent.addChild(cryText); // Spawn tears for (var tear = 0; tear < 3; tear++) { var tearDrop = new Text2('💧', { size: 15, fill: 0x00BFFF }); tearDrop.anchor.set(0.5, 0.5); tearDrop.x = self.x + (Math.random() - 0.5) * 50; tearDrop.y = self.y; self.parent.addChild(tearDrop); tween(tearDrop, { y: tearDrop.y + 200, alpha: 0 }, { duration: 2000, onFinish: function onFinish() { tearDrop.destroy(); } }); } LK.setTimeout(function () { cryText.destroy(); }, 2500); } }; 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 confetti if (Math.random() < 0.15) { for (var c = 0; c < 5; c++) { var confetti = new Text2('🎉', { size: 20 + Math.random() * 30, fill: Math.random() * 0xffffff }); confetti.anchor.set(0.5, 0.5); confetti.x = self.x + (Math.random() - 0.5) * 100; confetti.y = self.y + (Math.random() - 0.5) * 100; self.parent.addChild(confetti); tween(confetti, { alpha: 0, y: confetti.y + 200, rotation: Math.PI * 4 }, { duration: 2000, onFinish: function onFinish() { confetti.destroy(); } }); } } // Randomly become fortune cookie if (Math.random() < 0.12) { laser.tint = 0xDEB887; var fortunes = ['Your future is bright!', 'Beware of falling asteroids', 'Lucky numbers: 4, 8, 15, 16', 'A great adventure awaits', 'You will find true love']; var cookieText = new Text2('🥠 ' + fortunes[Math.floor(Math.random() * fortunes.length)], { size: 25, fill: 0x8B4513 }); cookieText.anchor.set(0.5, 0.5); cookieText.x = self.x; cookieText.y = self.y - 40; self.parent.addChild(cookieText); self.speed = 1; // Slow down LK.setTimeout(function () { cookieText.destroy(); }, 3000); } }; 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; } // Randomly become love letters if (Math.random() < 0.06) { laser.tint = 0xFF69B4; var loveText = new Text2('💌', { size: 40, fill: 0xFF1493 }); loveText.anchor.set(0.5, 0.5); loveText.x = self.x; loveText.y = self.y; self.parent.addChild(loveText); // Spawn hearts for (var h = 0; h < 3; h++) { var heart = new Text2('💖', { size: 20, fill: 0xFF69B4 }); heart.anchor.set(0.5, 0.5); heart.x = self.x + (Math.random() - 0.5) * 60; heart.y = self.y + (Math.random() - 0.5) * 60; self.parent.addChild(heart); tween(heart, { alpha: 0, scaleX: 2, scaleY: 2 }, { duration: 1500, onFinish: function onFinish() { heart.destroy(); } }); } LK.setTimeout(function () { loveText.destroy(); }, 1000); } // Randomly turn into rubber duck if (Math.random() < 0.08) { laser.tint = 0xFFFF00; laser.rotation += 0.1; var duckText = new Text2('🦆', { size: 30, fill: 0xFFFF00 }); duckText.anchor.set(0.5, 0.5); duckText.x = self.x; duckText.y = self.y; self.parent.addChild(duckText); LK.setTimeout(function () { duckText.destroy(); }, 500); } }; 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 become philosopher if (Math.random() < 0.04) { var philosophicalQuotes = ['TO BE OR NOT TO BE?', 'WHAT IS REALITY?', 'WHY DO WE EXIST?', 'IS THIS JUST A GAME?', 'WHAT IS THE MEANING?']; var philoText = new Text2('🤔 ' + philosophicalQuotes[Math.floor(Math.random() * philosophicalQuotes.length)], { size: 30, fill: 0x800080 }); philoText.anchor.set(0.5, 0.5); philoText.x = self.x; philoText.y = self.y - 80; self.parent.addChild(philoText); powerup.tint = 0x4B0082; LK.setTimeout(function () { philoText.destroy(); }, 4000); } }; 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 }; // Lag detection variables var lastTickTime = Date.now(); var lagDetected = false; var lagThreshold = 100; // 100ms threshold for lag detection var lagStrikeCount = 0; // Count consecutive lag events var lagStrikeLimit = 3; // Number of consecutive lag events before game over // 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 function spawnEnemy() { 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 function createExplosion(x, y, scale) { // Sometimes don't create explosion at all if (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 spawn mini wizards if (Math.random() < 0.3) { var wizardText = new Text2('🧙♂️', { size: 40, fill: 0x9932CC }); wizardText.anchor.set(0.5, 0.5); wizardText.x = x; wizardText.y = y; game.addChild(wizardText); // Make wizard cast spells var spellInterval = LK.setInterval(function () { var spellText = new Text2('✨', { size: 25, fill: 0xFFD700 }); spellText.anchor.set(0.5, 0.5); spellText.x = wizardText.x + (Math.random() - 0.5) * 100; spellText.y = wizardText.y + (Math.random() - 0.5) * 100; game.addChild(spellText); tween(spellText, { alpha: 0, scaleX: 3, scaleY: 3 }, { duration: 1000, onFinish: function onFinish() { spellText.destroy(); } }); }, 500); LK.setTimeout(function () { LK.clearInterval(spellInterval); wizardText.destroy(); }, 5000); } // Sometimes explosions spawn tiny ninjas if (Math.random() < 0.25) { for (var n = 0; n < 3; n++) { var ninja = new Text2('🥷', { size: 25, fill: 0x2F4F4F }); ninja.anchor.set(0.5, 0.5); ninja.x = x + (Math.random() - 0.5) * 150; ninja.y = y + (Math.random() - 0.5) * 150; game.addChild(ninja); // Make ninjas move stealthily var ninjaSpeed = 2 + Math.random() * 3; var ninjaDirection = Math.random() * Math.PI * 2; var ninjaInterval = LK.setInterval(function () { ninja.x += Math.cos(ninjaDirection) * ninjaSpeed; ninja.y += Math.sin(ninjaDirection) * ninjaSpeed; ninja.alpha = 0.3 + Math.sin(Date.now() * 0.01) * 0.3; }, 50); LK.setTimeout(function () { LK.clearInterval(ninjaInterval); ninja.destroy(); }, 4000); } } // Sometimes explosions spawn tiny dinosaurs if (Math.random() < 0.2) { var dinosaurs = ['🦕', '🦖', '🦴']; for (var d = 0; d < 2; d++) { var dino = new Text2(dinosaurs[Math.floor(Math.random() * dinosaurs.length)], { size: 35, fill: 0x228B22 }); dino.anchor.set(0.5, 0.5); dino.x = x + (Math.random() - 0.5) * 200; dino.y = y + (Math.random() - 0.5) * 200; game.addChild(dino); // Make dinosaurs roam around var dinoSpeed = 1 + Math.random() * 2; var dinoDirection = Math.random() * Math.PI * 2; var roarCount = 0; var dinoInterval = LK.setInterval(function () { dino.x += Math.cos(dinoDirection) * dinoSpeed; dino.y += Math.sin(dinoDirection) * dinoSpeed; dinoDirection += (Math.random() - 0.5) * 0.3; roarCount++; if (roarCount % 60 === 0) { var roarText = new Text2('ROAR!', { size: 25, fill: 0xFF4500 }); roarText.anchor.set(0.5, 0.5); roarText.x = dino.x; roarText.y = dino.y - 40; game.addChild(roarText); LK.setTimeout(function () { roarText.destroy(); }, 1000); } }, 50); LK.setTimeout(function () { LK.clearInterval(dinoInterval); dino.destroy(); }, 6000); } } } // 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; } // Randomly grow tentacles if (Math.random() < 0.01) { for (var t = 0; t < 4; t++) { var tentacle = new Text2('🐙', { size: 30, fill: 0x8A2BE2 }); tentacle.anchor.set(0.5, 0.5); tentacle.x = player.x + (Math.random() - 0.5) * 150; tentacle.y = player.y + (Math.random() - 0.5) * 150; game.addChild(tentacle); // Make tentacles wiggle var wiggleInterval = LK.setInterval(function () { tentacle.rotation += 0.3; tentacle.x += Math.sin(Date.now() * 0.01) * 5; tentacle.y += Math.cos(Date.now() * 0.01) * 5; }, 100); LK.setTimeout(function () { LK.clearInterval(wiggleInterval); tentacle.destroy(); }, 3000); } } // Randomly become disco ball if (Math.random() < 0.007) { player.tint = 0xC0C0C0; player.alpha = 0.8; var discoText = new Text2('🪩 DISCO FEVER! 🪩', { size: 60, fill: 0xFF69B4 }); discoText.anchor.set(0.5, 0.5); discoText.x = player.x; discoText.y = player.y - 100; game.addChild(discoText); // Spawn disco lights for (var d = 0; d < 12; d++) { var light = new Text2('✨', { size: 30, fill: Math.random() * 0xffffff }); light.anchor.set(0.5, 0.5); var angle = d / 12 * Math.PI * 2; light.x = player.x + Math.cos(angle) * 80; light.y = player.y + Math.sin(angle) * 80; game.addChild(light); // Rotate lights var lightInterval = LK.setInterval(function () { angle += 0.2; light.x = player.x + Math.cos(angle) * 80; light.y = player.y + Math.sin(angle) * 80; light.tint = Math.random() * 0xffffff; }, 100); LK.setTimeout(function () { LK.clearInterval(lightInterval); light.destroy(); }, 4000); } LK.setTimeout(function () { discoText.destroy(); player.tint = 0xFFFFFF; player.alpha = 1; }, 4000); } // Randomly become time traveler if (Math.random() < 0.005) { var timeText = new Text2('⏰ TIME TRAVEL ACTIVATED! ⏰', { size: 70, fill: 0x00CED1 }); timeText.anchor.set(0.5, 0.5); timeText.x = player.x; timeText.y = player.y - 120; game.addChild(timeText); // Create time portal effect for (var t = 0; t < 8; t++) { var portal = new Text2('🌀', { size: 40, fill: 0x4169E1 }); portal.anchor.set(0.5, 0.5); var portalAngle = t / 8 * Math.PI * 2; portal.x = player.x + Math.cos(portalAngle) * 100; portal.y = player.y + Math.sin(portalAngle) * 100; game.addChild(portal); // Rotate portal effect var portalInterval = LK.setInterval(function () { portalAngle += 0.3; portal.x = player.x + Math.cos(portalAngle) * 100; portal.y = player.y + Math.sin(portalAngle) * 100; portal.rotation += 0.2; }, 50); LK.setTimeout(function () { LK.clearInterval(portalInterval); portal.destroy(); }, 4000); } // Show random time periods var timePeriods = ['1885 - Wild West!', '1955 - Back to the Future!', '2085 - The Future!', '1776 - Independence!', '1969 - Moon Landing!']; var periodText = new Text2(timePeriods[Math.floor(Math.random() * timePeriods.length)], { size: 50, fill: 0xFFD700 }); periodText.anchor.set(0.5, 0.5); periodText.x = player.x; periodText.y = player.y + 80; game.addChild(periodText); LK.setTimeout(function () { timeText.destroy(); periodText.destroy(); }, 4000); } // Auto-fire if (LK.ticks % 10 === 0) { firePlayerLaser(); } } // Handle collisions between game objects function handleCollisions() { // 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)) { // Store player position before destroying var playerX = player.x; var playerY = player.y; // Create Deadship at player position var deadship = game.attachAsset('Deadship', { anchorX: 0.5, anchorY: 0.5 }); deadship.x = playerX; deadship.y = playerY; // Drop a 90¢ coin (but don't add to powerups since player is dead) var coin = game.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); coin.x = playerX; coin.y = playerY; coin.tint = 0xf1c40f; // Yellow color for coin // Make the coin fall and fade out tween(coin, { y: playerY + 200, alpha: 0 }, { duration: 2000, onFinish: function onFinish() { coin.destroy(); } }); // Create explosion effect createExplosion(playerX, playerY, 1.5); // Destroy player player.destroy(); player = null; // Save high score if needed if (score > storage.highScore) { storage.highScore = score; } // Show "You lost" text var loseText = new Text2('You lost!', { size: 100, fill: 0xFF0000 }); loseText.anchor.set(0.5, 0.5); loseText.x = 1024; loseText.y = 1366; game.addChild(loseText); tween(loseText, { alpha: 0, y: 1266 }, { duration: 2000, onFinish: function onFinish() { loseText.destroy(); LK.showGameOver(); } }); // 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)) { // Damage player player.damage(); // 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); } // Check for game over if (player.lives <= 0) { // Game over createExplosion(player.x, player.y, 1.5); player.destroy(); player = null; // Save high score if needed if (score > storage.highScore) { storage.highScore = score; } // Show game over after a delay LK.setTimeout(function () { LK.showGameOver(); }, 1000); } } // 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)) { // Damage player player.damage(); // 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); } // Check for game over if (player.lives <= 0) { // Game over createExplosion(player.x, player.y, 1.5); player.destroy(); player = null; // Save high score if needed if (score > storage.highScore) { storage.highScore = score; } // Show game over after a delay LK.setTimeout(function () { LK.showGameOver(); }, 1000); } } // 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)) { // Apply powerup player.upgrade(powerup.type); // Update UI if life powerup if (powerup.type === 'life') { livesText.setText('LIVES: ' + player.lives); } // Randomly scream when collected if (Math.random() < 0.4) { var screamText = new Text2('AAAAHHHHH!!! 😱', { size: 60, fill: 0xFF0000 }); screamText.anchor.set(0.5, 0.5); screamText.x = powerup.x; screamText.y = powerup.y; game.addChild(screamText); tween(screamText, { alpha: 0, y: screamText.y - 150, scaleX: 2, scaleY: 2 }, { duration: 1500, onFinish: function onFinish() { screamText.destroy(); } }); } // 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)) { // Damage player player.damage(); // Update UI livesText.setText('LIVES: ' + player.lives); // Check for game over if (player.lives <= 0) { // Game over createExplosion(player.x, player.y, 1.5); player.destroy(); player = null; // Save high score if needed if (score > storage.highScore) { storage.highScore = score; } // Show game over after a delay LK.setTimeout(function () { LK.showGameOver(); }, 1000); } } } // 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 () { // Check for lag var currentTime = Date.now(); var deltaTime = currentTime - lastTickTime; lastTickTime = currentTime; if (deltaTime > lagThreshold && !lagDetected) { lagDetected = true; lagStrikeCount++; // Reset screen to black game.setBackgroundColor(0x000000); // Remove all game objects if (player) { player.destroy(); player = null; } for (var i = 0; i < playerLasers.length; i++) { playerLasers[i].destroy(); } playerLasers = []; for (var i = 0; i < enemies.length; i++) { enemies[i].destroy(); } enemies = []; for (var i = 0; i < enemyLasers.length; i++) { enemyLasers[i].destroy(); } enemyLasers = []; for (var i = 0; i < asteroids.length; i++) { asteroids[i].destroy(); } asteroids = []; for (var i = 0; i < powerups.length; i++) { powerups[i].destroy(); } powerups = []; for (var i = 0; i < explosions.length; i++) { explosions[i].destroy(); } explosions = []; if (boss) { boss.destroy(); boss = null; } // Add Aguhhhhh asset in middle of screen var aguhhhhAsset = game.attachAsset('Aughhhhh', { anchorX: 0.5, anchorY: 0.5, scaleX: 10, scaleY: 10 }); aguhhhhAsset.x = 1024; aguhhhhAsset.y = 1366; // Play Aguhhhhh sound LK.getSound('Aguhhhhh').play(); if (lagStrikeCount >= lagStrikeLimit) { // Too much lag, show game over after a short delay LK.setTimeout(function () { aguhhhhAsset.destroy(); lagDetected = false; lagStrikeCount = 0; LK.showGameOver(); }, 2000); } else { // Reset game after 3 seconds LK.setTimeout(function () { aguhhhhAsset.destroy(); lagDetected = false; initGame(); }, 3000); } return; } if (gameState === 'won') { return; // Prevent further updates until game is restarted manually } if (gameState !== 'playing') { return; } // Handle player input if (player) { handlePlayerInput(); } // 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]); } } // 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); } // UI elements randomly start rapping if (Math.random() < 0.008) { var rapLyrics = ['YO YO YO CHECK THE SCORE', 'LIVES ARE LIFE, LIFE IS LIVES', 'WAVE SO FRESH, WAVE SO CLEAN', 'BOOM BOOM POW LASER SOUND']; var rapText = new Text2('🎤 ' + rapLyrics[Math.floor(Math.random() * rapLyrics.length)] + ' 🎤', { size: 50, fill: 0x00FF00 }); rapText.anchor.set(0.5, 0.5); rapText.x = 1024; rapText.y = 400; game.addChild(rapText); // Make it bounce var bounceCount = 0; var bounceInterval = LK.setInterval(function () { rapText.scaleX = 1 + Math.sin(bounceCount * 0.5) * 0.3; rapText.scaleY = 1 + Math.sin(bounceCount * 0.5) * 0.3; bounceCount++; }, 100); LK.setTimeout(function () { LK.clearInterval(bounceInterval); rapText.destroy(); }, 3000); } 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)); } // Randomly display cooking recipes if (Math.random() < 0.01) { var recipes = ['Mix 2 cups flour, 1 egg', 'Preheat oven to 350°F', 'Add salt and pepper to taste', 'Boil water for 8 minutes', 'Serve with butter']; var recipeText = new Text2('👨🍳 RECIPE: ' + recipes[Math.floor(Math.random() * recipes.length)], { size: 45, fill: 0xFF6347 }); recipeText.anchor.set(0.5, 0.5); recipeText.x = 1024; recipeText.y = 600; game.addChild(recipeText); // Add chef hat var chefText = new Text2('👨🍳', { size: 60, fill: 0xFFFFFF }); chefText.anchor.set(0.5, 0.5); chefText.x = 1024; chefText.y = 500; game.addChild(chefText); LK.setTimeout(function () { recipeText.destroy(); chefText.destroy(); }, 4000); } // 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)]); } // 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); } // Handle collisions handleCollisions(); };
===================================================================
--- original.js
+++ change.js
@@ -34,105 +34,99 @@
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
+ // Randomly become soap bubble
+ if (Math.random() < 0.02) {
+ asteroid.tint = 0x87CEEB;
+ asteroid.alpha = 0.3;
+ var bubbleText = new Text2('🫧', {
+ size: 50,
+ fill: 0x00BFFF
});
- 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();
- }
- });
+ bubbleText.anchor.set(0.5, 0.5);
+ bubbleText.x = self.x;
+ bubbleText.y = self.y;
+ self.parent.addChild(bubbleText);
+ // Bubble floats upward
+ self.speed.y = -1;
+ self.speed.x = Math.sin(Date.now() * 0.001) * 2;
+ LK.setTimeout(function () {
+ if (bubbleText.parent) bubbleText.destroy();
+ asteroid.tint = 0x95a5a6;
+ asteroid.alpha = 1;
+ }, 4000);
}
- // 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
+ // Randomly become space taco
+ if (Math.random() < 0.03) {
+ asteroid.tint = 0xDAA520;
+ var tacoText = new Text2('🌮 SPACE TACO! 🌮', {
+ size: 40,
+ fill: 0xFF4500
+ });
+ tacoText.anchor.set(0.5, 0.5);
+ tacoText.x = self.x;
+ tacoText.y = self.y - 70;
+ self.parent.addChild(tacoText);
+ // Spawn taco ingredients
+ var ingredients = ['🥬', '🍅', '🧀', '🥩', '🌶️'];
+ for (var i = 0; i < 3; i++) {
+ var ingredient = new Text2(ingredients[Math.floor(Math.random() * ingredients.length)], {
+ size: 20,
+ fill: 0xFFFFFF
});
- 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, {
+ ingredient.anchor.set(0.5, 0.5);
+ ingredient.x = self.x + (Math.random() - 0.5) * 80;
+ ingredient.y = self.y + (Math.random() - 0.5) * 80;
+ self.parent.addChild(ingredient);
+ tween(ingredient, {
alpha: 0,
- rotation: Math.PI * 2
+ y: ingredient.y + 100
}, {
- duration: 2000,
+ duration: 2500,
onFinish: function onFinish() {
- discoLight.destroy();
+ ingredient.destroy();
}
});
}
- var partyText = new Text2('🕺 PARTY TIME! 💃', {
+ LK.setTimeout(function () {
+ tacoText.destroy();
+ asteroid.tint = 0x95a5a6;
+ }, 3000);
+ }
+ // Randomly become invisible/visible
+ if (Math.random() < 0.05) {
+ asteroid.alpha = asteroid.alpha > 0.5 ? 0.1 : 1;
+ }
+ // Randomly start disco dancing
+ if (Math.random() < 0.003) {
+ asteroid.tint = 0xFF1493;
+ var discoText = new Text2('🕺 DISCO FEVER! 🕺', {
size: 40,
- fill: 0xFF1493
+ fill: 0x00FFFF
});
- 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');
+ discoText.anchor.set(0.5, 0.5);
+ discoText.x = self.x;
+ discoText.y = self.y - 100;
+ self.parent.addChild(discoText);
+ // Make asteroid dance
+ for (var d = 0; d < 10; d++) {
+ LK.setTimeout(function () {
+ asteroid.rotation += Math.PI / 4;
+ asteroid.scaleX = 1 + Math.sin(Date.now() * 0.01) * 0.5;
+ asteroid.scaleY = 1 + Math.cos(Date.now() * 0.01) * 0.5;
+ }, d * 200);
+ }
+ LK.setTimeout(function () {
+ discoText.destroy();
+ asteroid.tint = 0x95a5a6;
+ }, 2000);
}
};
return self;
});
@@ -269,51 +263,105 @@
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
+ // Randomly transform into giant pizza
+ if (Math.random() < 0.002) {
+ ship.tint = 0xFFD700;
+ var pizzaText = new Text2('🍕 I AM PIZZA BOSS NOW! 🍕', {
+ size: 80,
+ fill: 0xFF4500
});
- 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();
- }
+ pizzaText.anchor.set(0.5, 0.5);
+ pizzaText.x = self.x;
+ pizzaText.y = self.y - 200;
+ self.parent.addChild(pizzaText);
+ ship.rotation += 0.2;
+ LK.setTimeout(function () {
+ pizzaText.destroy();
+ ship.tint = self.level > 1 ? 0xcc00cc : 0x9b59b6;
+ }, 3000);
+ }
+ // Randomly become motivational speaker
+ if (Math.random() < 0.003) {
+ var motivationalQuotes = ['BELIEVE IN YOURSELF!', 'YOU CAN DO IT!', 'NEVER GIVE UP!', 'FOLLOW YOUR DREAMS!', 'BE THE CHANGE!'];
+ var motivText = new Text2('📢 ' + motivationalQuotes[Math.floor(Math.random() * motivationalQuotes.length)], {
+ size: 70,
+ fill: 0x32CD32
});
+ motivText.anchor.set(0.5, 0.5);
+ motivText.x = self.x;
+ motivText.y = self.y - 180;
+ self.parent.addChild(motivText);
+ // Add sparkles
+ for (var s = 0; s < 8; s++) {
+ var sparkle = new Text2('✨', {
+ size: 25,
+ fill: 0xFFD700
+ });
+ sparkle.anchor.set(0.5, 0.5);
+ sparkle.x = self.x + (Math.random() - 0.5) * 300;
+ sparkle.y = self.y + (Math.random() - 0.5) * 200;
+ self.parent.addChild(sparkle);
+ tween(sparkle, {
+ alpha: 0,
+ rotation: Math.PI * 2
+ }, {
+ duration: 3000,
+ onFinish: function onFinish() {
+ sparkle.destroy();
+ }
+ });
+ }
+ LK.setTimeout(function () {
+ motivText.destroy();
+ }, 3500);
}
- // 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
+ // Randomly become giant rubber duck
+ if (Math.random() < 0.001) {
+ ship.tint = 0xFFFF00;
+ var duckText = new Text2('🦆 QUACK QUACK I AM DUCK BOSS! 🦆', {
+ size: 90,
+ fill: 0xFF8C00
});
- 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();
- }
- });
+ duckText.anchor.set(0.5, 0.5);
+ duckText.x = self.x;
+ duckText.y = self.y - 250;
+ self.parent.addChild(duckText);
+ // Make boss bounce like a rubber duck
+ var bounceCount = 0;
+ var bounceInterval = LK.setInterval(function () {
+ ship.y += Math.sin(bounceCount * 0.3) * 5;
+ ship.rotation = Math.sin(bounceCount * 0.2) * 0.2;
+ bounceCount++;
+ }, 100);
+ // Spawn rubber duck sounds
+ var quackInterval = LK.setInterval(function () {
+ var quackText = new Text2('QUACK!', {
+ size: 40,
+ fill: 0xFFFF00
+ });
+ quackText.anchor.set(0.5, 0.5);
+ quackText.x = self.x + (Math.random() - 0.5) * 200;
+ quackText.y = self.y + (Math.random() - 0.5) * 150;
+ self.parent.addChild(quackText);
+ tween(quackText, {
+ alpha: 0,
+ y: quackText.y - 50
+ }, {
+ duration: 1000,
+ onFinish: function onFinish() {
+ quackText.destroy();
+ }
+ });
+ }, 800);
+ LK.setTimeout(function () {
+ LK.clearInterval(bounceInterval);
+ LK.clearInterval(quackInterval);
+ duckText.destroy();
+ ship.tint = self.level > 1 ? 0xcc00cc : 0x9b59b6;
+ ship.rotation = 0;
+ }, 5000);
}
};
return self;
});
@@ -378,14 +426,28 @@
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');
+ // Randomly quote Shakespeare
+ if (Math.random() < 0.01) {
+ var quotes = ['To be or not to be', 'Et tu, Brute?', 'All the world\'s a stage', 'Something wicked this way comes', 'Double, double toil and trouble'];
+ var shakespeareText = new Text2(quotes[Math.floor(Math.random() * quotes.length)], {
+ size: 25,
+ fill: 0xFF69B4
+ });
+ shakespeareText.anchor.set(0.5, 0.5);
+ shakespeareText.x = self.x;
+ shakespeareText.y = self.y - 50;
+ self.parent.addChild(shakespeareText);
+ tween(shakespeareText, {
+ alpha: 0,
+ y: shakespeareText.y - 100
+ }, {
+ duration: 3000,
+ onFinish: function onFinish() {
+ shakespeareText.destroy();
+ }
+ });
}
// Pattern movement
if (self.movement.pattern === 'sine') {
self.x = self.initialX + Math.sin(LK.ticks * 0.05 + self.movement.phase) * self.movement.amplitude;
@@ -394,37 +456,41 @@
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
+ // Randomly start crying
+ if (Math.random() < 0.015) {
+ var cryText = new Text2('😭 WHY AM I HERE?! 😭', {
+ size: 35,
+ fill: 0x1E90FF
});
- 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
+ cryText.anchor.set(0.5, 0.5);
+ cryText.x = self.x;
+ cryText.y = self.y - 60;
+ self.parent.addChild(cryText);
+ // Spawn tears
+ for (var tear = 0; tear < 3; tear++) {
+ var tearDrop = new Text2('💧', {
+ size: 15,
+ fill: 0x00BFFF
+ });
+ tearDrop.anchor.set(0.5, 0.5);
+ tearDrop.x = self.x + (Math.random() - 0.5) * 50;
+ tearDrop.y = self.y;
+ self.parent.addChild(tearDrop);
+ tween(tearDrop, {
+ y: tearDrop.y + 200,
+ alpha: 0
+ }, {
+ duration: 2000,
+ onFinish: function onFinish() {
+ tearDrop.destroy();
+ }
+ });
+ }
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();
- }
- });
+ cryText.destroy();
+ }, 2500);
}
};
return self;
});
@@ -447,52 +513,48 @@
// 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
+ // Randomly turn into confetti
+ if (Math.random() < 0.15) {
+ for (var c = 0; c < 5; c++) {
+ var confetti = new Text2('🎉', {
+ size: 20 + Math.random() * 30,
+ fill: Math.random() * 0xffffff
});
- 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, {
+ confetti.anchor.set(0.5, 0.5);
+ confetti.x = self.x + (Math.random() - 0.5) * 100;
+ confetti.y = self.y + (Math.random() - 0.5) * 100;
+ self.parent.addChild(confetti);
+ tween(confetti, {
alpha: 0,
- scaleX: 0,
- scaleY: 0
+ y: confetti.y + 200,
+ rotation: Math.PI * 4
}, {
- 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();
+ confetti.destroy();
}
});
}
}
+ // Randomly become fortune cookie
+ if (Math.random() < 0.12) {
+ laser.tint = 0xDEB887;
+ var fortunes = ['Your future is bright!', 'Beware of falling asteroids', 'Lucky numbers: 4, 8, 15, 16', 'A great adventure awaits', 'You will find true love'];
+ var cookieText = new Text2('🥠 ' + fortunes[Math.floor(Math.random() * fortunes.length)], {
+ size: 25,
+ fill: 0x8B4513
+ });
+ cookieText.anchor.set(0.5, 0.5);
+ cookieText.x = self.x;
+ cookieText.y = self.y - 40;
+ self.parent.addChild(cookieText);
+ self.speed = 1; // Slow down
+ LK.setTimeout(function () {
+ cookieText.destroy();
+ }, 3000);
+ }
};
return self;
});
var Explosion = Container.expand(function () {
@@ -624,15 +686,60 @@
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();
+ // Randomly become love letters
+ if (Math.random() < 0.06) {
+ laser.tint = 0xFF69B4;
+ var loveText = new Text2('💌', {
+ size: 40,
+ fill: 0xFF1493
+ });
+ loveText.anchor.set(0.5, 0.5);
+ loveText.x = self.x;
+ loveText.y = self.y;
+ self.parent.addChild(loveText);
+ // Spawn hearts
+ for (var h = 0; h < 3; h++) {
+ var heart = new Text2('💖', {
+ size: 20,
+ fill: 0xFF69B4
+ });
+ heart.anchor.set(0.5, 0.5);
+ heart.x = self.x + (Math.random() - 0.5) * 60;
+ heart.y = self.y + (Math.random() - 0.5) * 60;
+ self.parent.addChild(heart);
+ tween(heart, {
+ alpha: 0,
+ scaleX: 2,
+ scaleY: 2
+ }, {
+ duration: 1500,
+ onFinish: function onFinish() {
+ heart.destroy();
+ }
+ });
+ }
+ LK.setTimeout(function () {
+ loveText.destroy();
+ }, 1000);
}
+ // Randomly turn into rubber duck
+ if (Math.random() < 0.08) {
+ laser.tint = 0xFFFF00;
+ laser.rotation += 0.1;
+ var duckText = new Text2('🦆', {
+ size: 30,
+ fill: 0xFFFF00
+ });
+ duckText.anchor.set(0.5, 0.5);
+ duckText.x = self.x;
+ duckText.y = self.y;
+ self.parent.addChild(duckText);
+ LK.setTimeout(function () {
+ duckText.destroy();
+ }, 500);
+ }
};
return self;
});
var Powerup = Container.expand(function (type) {
@@ -662,17 +769,23 @@
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);
- }
+ // Randomly become philosopher
+ if (Math.random() < 0.04) {
+ var philosophicalQuotes = ['TO BE OR NOT TO BE?', 'WHAT IS REALITY?', 'WHY DO WE EXIST?', 'IS THIS JUST A GAME?', 'WHAT IS THE MEANING?'];
+ var philoText = new Text2('🤔 ' + philosophicalQuotes[Math.floor(Math.random() * philosophicalQuotes.length)], {
+ size: 30,
+ fill: 0x800080
+ });
+ philoText.anchor.set(0.5, 0.5);
+ philoText.x = self.x;
+ philoText.y = self.y - 80;
+ self.parent.addChild(philoText);
+ powerup.tint = 0x4B0082;
+ LK.setTimeout(function () {
+ philoText.destroy();
+ }, 4000);
}
};
return self;
});
@@ -1010,45 +1123,110 @@
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!', {
+ // Sometimes explosions spawn mini wizards
+ if (Math.random() < 0.3) {
+ var wizardText = new Text2('🧙♂️', {
size: 40,
- fill: 0xFFFF00
+ fill: 0x9932CC
});
- 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();
- }
- });
+ wizardText.anchor.set(0.5, 0.5);
+ wizardText.x = x;
+ wizardText.y = y;
+ game.addChild(wizardText);
+ // Make wizard cast spells
+ var spellInterval = LK.setInterval(function () {
+ var spellText = new Text2('✨', {
+ size: 25,
+ fill: 0xFFD700
+ });
+ spellText.anchor.set(0.5, 0.5);
+ spellText.x = wizardText.x + (Math.random() - 0.5) * 100;
+ spellText.y = wizardText.y + (Math.random() - 0.5) * 100;
+ game.addChild(spellText);
+ tween(spellText, {
+ alpha: 0,
+ scaleX: 3,
+ scaleY: 3
+ }, {
+ duration: 1000,
+ onFinish: function onFinish() {
+ spellText.destroy();
+ }
+ });
+ }, 500);
+ LK.setTimeout(function () {
+ LK.clearInterval(spellInterval);
+ wizardText.destroy();
+ }, 5000);
}
+ // Sometimes explosions spawn tiny ninjas
+ if (Math.random() < 0.25) {
+ for (var n = 0; n < 3; n++) {
+ var ninja = new Text2('🥷', {
+ size: 25,
+ fill: 0x2F4F4F
+ });
+ ninja.anchor.set(0.5, 0.5);
+ ninja.x = x + (Math.random() - 0.5) * 150;
+ ninja.y = y + (Math.random() - 0.5) * 150;
+ game.addChild(ninja);
+ // Make ninjas move stealthily
+ var ninjaSpeed = 2 + Math.random() * 3;
+ var ninjaDirection = Math.random() * Math.PI * 2;
+ var ninjaInterval = LK.setInterval(function () {
+ ninja.x += Math.cos(ninjaDirection) * ninjaSpeed;
+ ninja.y += Math.sin(ninjaDirection) * ninjaSpeed;
+ ninja.alpha = 0.3 + Math.sin(Date.now() * 0.01) * 0.3;
+ }, 50);
+ LK.setTimeout(function () {
+ LK.clearInterval(ninjaInterval);
+ ninja.destroy();
+ }, 4000);
+ }
+ }
+ // Sometimes explosions spawn tiny dinosaurs
+ if (Math.random() < 0.2) {
+ var dinosaurs = ['🦕', '🦖', '🦴'];
+ for (var d = 0; d < 2; d++) {
+ var dino = new Text2(dinosaurs[Math.floor(Math.random() * dinosaurs.length)], {
+ size: 35,
+ fill: 0x228B22
+ });
+ dino.anchor.set(0.5, 0.5);
+ dino.x = x + (Math.random() - 0.5) * 200;
+ dino.y = y + (Math.random() - 0.5) * 200;
+ game.addChild(dino);
+ // Make dinosaurs roam around
+ var dinoSpeed = 1 + Math.random() * 2;
+ var dinoDirection = Math.random() * Math.PI * 2;
+ var roarCount = 0;
+ var dinoInterval = LK.setInterval(function () {
+ dino.x += Math.cos(dinoDirection) * dinoSpeed;
+ dino.y += Math.sin(dinoDirection) * dinoSpeed;
+ dinoDirection += (Math.random() - 0.5) * 0.3;
+ roarCount++;
+ if (roarCount % 60 === 0) {
+ var roarText = new Text2('ROAR!', {
+ size: 25,
+ fill: 0xFF4500
+ });
+ roarText.anchor.set(0.5, 0.5);
+ roarText.x = dino.x;
+ roarText.y = dino.y - 40;
+ game.addChild(roarText);
+ LK.setTimeout(function () {
+ roarText.destroy();
+ }, 1000);
+ }
+ }, 50);
+ LK.setTimeout(function () {
+ LK.clearInterval(dinoInterval);
+ dino.destroy();
+ }, 6000);
+ }
+ }
}
// Create a powerup
function spawnPowerup(x, y, type) {
var powerup = new Powerup(type);
@@ -1075,48 +1253,119 @@
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
+ // Randomly grow tentacles
+ if (Math.random() < 0.01) {
+ for (var t = 0; t < 4; t++) {
+ var tentacle = new Text2('🐙', {
+ size: 30,
+ fill: 0x8A2BE2
+ });
+ tentacle.anchor.set(0.5, 0.5);
+ tentacle.x = player.x + (Math.random() - 0.5) * 150;
+ tentacle.y = player.y + (Math.random() - 0.5) * 150;
+ game.addChild(tentacle);
+ // Make tentacles wiggle
+ var wiggleInterval = LK.setInterval(function () {
+ tentacle.rotation += 0.3;
+ tentacle.x += Math.sin(Date.now() * 0.01) * 5;
+ tentacle.y += Math.cos(Date.now() * 0.01) * 5;
+ }, 100);
+ LK.setTimeout(function () {
+ LK.clearInterval(wiggleInterval);
+ tentacle.destroy();
+ }, 3000);
+ }
+ }
+ // Randomly become disco ball
+ if (Math.random() < 0.007) {
+ player.tint = 0xC0C0C0;
+ player.alpha = 0.8;
+ var discoText = new Text2('🪩 DISCO FEVER! 🪩', {
+ size: 60,
+ fill: 0xFF69B4
});
- 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();
- }
+ discoText.anchor.set(0.5, 0.5);
+ discoText.x = player.x;
+ discoText.y = player.y - 100;
+ game.addChild(discoText);
+ // Spawn disco lights
+ for (var d = 0; d < 12; d++) {
+ var light = new Text2('✨', {
+ size: 30,
+ fill: Math.random() * 0xffffff
+ });
+ light.anchor.set(0.5, 0.5);
+ var angle = d / 12 * Math.PI * 2;
+ light.x = player.x + Math.cos(angle) * 80;
+ light.y = player.y + Math.sin(angle) * 80;
+ game.addChild(light);
+ // Rotate lights
+ var lightInterval = LK.setInterval(function () {
+ angle += 0.2;
+ light.x = player.x + Math.cos(angle) * 80;
+ light.y = player.y + Math.sin(angle) * 80;
+ light.tint = Math.random() * 0xffffff;
+ }, 100);
+ LK.setTimeout(function () {
+ LK.clearInterval(lightInterval);
+ light.destroy();
+ }, 4000);
+ }
+ LK.setTimeout(function () {
+ discoText.destroy();
+ player.tint = 0xFFFFFF;
+ player.alpha = 1;
+ }, 4000);
+ }
+ // Randomly become time traveler
+ if (Math.random() < 0.005) {
+ var timeText = new Text2('⏰ TIME TRAVEL ACTIVATED! ⏰', {
+ size: 70,
+ fill: 0x00CED1
});
- // Player sometimes goes on strike
- if (Math.random() < 0.3) {
- player.canShoot = false;
- var strikeText = new Text2('ON STRIKE!', {
- size: 50,
- fill: 0xFF0000
+ timeText.anchor.set(0.5, 0.5);
+ timeText.x = player.x;
+ timeText.y = player.y - 120;
+ game.addChild(timeText);
+ // Create time portal effect
+ for (var t = 0; t < 8; t++) {
+ var portal = new Text2('🌀', {
+ size: 40,
+ fill: 0x4169E1
});
- strikeText.anchor.set(0.5, 0.5);
- strikeText.x = player.x;
- strikeText.y = player.y + 120;
- game.addChild(strikeText);
+ portal.anchor.set(0.5, 0.5);
+ var portalAngle = t / 8 * Math.PI * 2;
+ portal.x = player.x + Math.cos(portalAngle) * 100;
+ portal.y = player.y + Math.sin(portalAngle) * 100;
+ game.addChild(portal);
+ // Rotate portal effect
+ var portalInterval = LK.setInterval(function () {
+ portalAngle += 0.3;
+ portal.x = player.x + Math.cos(portalAngle) * 100;
+ portal.y = player.y + Math.sin(portalAngle) * 100;
+ portal.rotation += 0.2;
+ }, 50);
LK.setTimeout(function () {
- if (player) {
- player.canShoot = true;
- }
- if (strikeText && strikeText.parent) {
- strikeText.destroy();
- }
- }, 2000);
+ LK.clearInterval(portalInterval);
+ portal.destroy();
+ }, 4000);
}
+ // Show random time periods
+ var timePeriods = ['1885 - Wild West!', '1955 - Back to the Future!', '2085 - The Future!', '1776 - Independence!', '1969 - Moon Landing!'];
+ var periodText = new Text2(timePeriods[Math.floor(Math.random() * timePeriods.length)], {
+ size: 50,
+ fill: 0xFFD700
+ });
+ periodText.anchor.set(0.5, 0.5);
+ periodText.x = player.x;
+ periodText.y = player.y + 80;
+ game.addChild(periodText);
+ LK.setTimeout(function () {
+ timeText.destroy();
+ periodText.destroy();
+ }, 4000);
}
// Auto-fire
if (LK.ticks % 10 === 0) {
firePlayerLaser();
@@ -1239,37 +1488,8 @@
// Enemy lasers vs player
for (var i = enemyLasers.length - 1; i >= 0; i--) {
var laser = enemyLasers[i];
if (player && laser.intersects(player)) {
- // Sometimes enemy lasers heal player instead of hurting
- if (Math.random() < 0.3) {
- 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();
- laser.destroy();
- enemyLasers.splice(i, 1);
- continue;
- }
// Store player position before destroying
var playerX = player.x;
var playerY = player.y;
// Create Deadship at player position
@@ -1424,35 +1644,36 @@
// 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,
+ // Apply powerup
+ player.upgrade(powerup.type);
+ // Update UI if life powerup
+ if (powerup.type === 'life') {
+ livesText.setText('LIVES: ' + player.lives);
+ }
+ // Randomly scream when collected
+ if (Math.random() < 0.4) {
+ var screamText = new Text2('AAAAHHHHH!!! 😱', {
+ size: 60,
fill: 0xFF0000
});
- fakeGameOver.anchor.set(0.5, 0.5);
- fakeGameOver.x = 1024;
- fakeGameOver.y = 1366;
- game.addChild(fakeGameOver);
- tween(fakeGameOver, {
+ screamText.anchor.set(0.5, 0.5);
+ screamText.x = powerup.x;
+ screamText.y = powerup.y;
+ game.addChild(screamText);
+ tween(screamText, {
alpha: 0,
- scaleX: 0,
- scaleY: 0
+ y: screamText.y - 150,
+ scaleX: 2,
+ scaleY: 2
}, {
- duration: 3000,
+ duration: 1500,
onFinish: function onFinish() {
- fakeGameOver.destroy();
+ screamText.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) {
@@ -1586,36 +1807,8 @@
}
// 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--;
@@ -1639,39 +1832,8 @@
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;
}
@@ -1679,101 +1841,65 @@
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)]);
+ // UI elements randomly start rapping
+ if (Math.random() < 0.008) {
+ var rapLyrics = ['YO YO YO CHECK THE SCORE', 'LIVES ARE LIFE, LIFE IS LIVES', 'WAVE SO FRESH, WAVE SO CLEAN', 'BOOM BOOM POW LASER SOUND'];
+ var rapText = new Text2('🎤 ' + rapLyrics[Math.floor(Math.random() * rapLyrics.length)] + ' 🎤', {
+ size: 50,
+ fill: 0x00FF00
+ });
+ rapText.anchor.set(0.5, 0.5);
+ rapText.x = 1024;
+ rapText.y = 400;
+ game.addChild(rapText);
+ // Make it bounce
+ var bounceCount = 0;
+ var bounceInterval = LK.setInterval(function () {
+ rapText.scaleX = 1 + Math.sin(bounceCount * 0.5) * 0.3;
+ rapText.scaleY = 1 + Math.sin(bounceCount * 0.5) * 0.3;
+ bounceCount++;
+ }, 100);
+ LK.setTimeout(function () {
+ LK.clearInterval(bounceInterval);
+ rapText.destroy();
+ }, 3000);
}
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
+ // Randomly display cooking recipes
+ if (Math.random() < 0.01) {
+ var recipes = ['Mix 2 cups flour, 1 egg', 'Preheat oven to 350°F', 'Add salt and pepper to taste', 'Boil water for 8 minutes', 'Serve with butter'];
+ var recipeText = new Text2('👨🍳 RECIPE: ' + recipes[Math.floor(Math.random() * recipes.length)], {
+ size: 45,
+ fill: 0xFF6347
});
- 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
+ recipeText.anchor.set(0.5, 0.5);
+ recipeText.x = 1024;
+ recipeText.y = 600;
+ game.addChild(recipeText);
+ // Add chef hat
+ var chefText = new Text2('👨🍳', {
+ size: 60,
+ fill: 0xFFFFFF
});
- tween(accentText, {
- scaleX: 1,
- scaleY: 1
- }, {
- duration: 500,
- delay: 500
- });
- tween(accentText, {
- alpha: 0,
- rotation: 0.3
- }, {
- duration: 3000,
- onFinish: function onFinish() {
- accentText.destroy();
- }
- });
+ chefText.anchor.set(0.5, 0.5);
+ chefText.x = 1024;
+ chefText.y = 500;
+ game.addChild(chefText);
+ LK.setTimeout(function () {
+ recipeText.destroy();
+ chefText.destroy();
+ }, 4000);
}
// 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,
@@ -1812,98 +1938,7 @@
}
}, 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();
- }
// Handle collisions
handleCollisions();
};
\ No newline at end of file
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