User prompt
Add a new feature: Krusty Burger! Unlock weapons using the gold you obtain from games! (Weapons: Slingshot: The Default Weapon; Dart gun: Deals high damage but has a slow fire rate; Ducky Triple barrel: shoots 3 strong projectiles like if you had a shotgun; Krusty's flower flower: A water beam that deals low damage every 0.10 seconds)
User prompt
Add a title screen into the game
User prompt
Add a title screen into the game
User prompt
Now there are INFINITE waves
User prompt
Now there's 2 different sounds for collecting powerups and collecting coins
User prompt
Aliens are now invincible for the first 3 seconds of their lifetime to prevent cheesing the game ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make it 2567 pixels
User prompt
Shooter mutant should have a higher range...
User prompt
Add new Enemies: Fast mutant (a mutant that is faster than any other mutant but is fragile: starts spawning at wave 2 alongside all other enemies that appear), Shooter mutant (shoots bowling balls st Bart! That's a bowling problem! Starts appearing at wave 7)
User prompt
Add 15 more waves!
User prompt
Bart now says the hut sound effect when hit
Code edit (1 edits merged)
Please save this source code
User prompt
Bart vs the Space Mutants
Initial prompt
Bart vs the space mutants: an RPG game where Bart Simpson goes on a mission to stop the space mutants, kind of like the NES game
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Bart = Container.expand(function () { var self = Container.call(this); var bartGraphics = self.attachAsset('bart', { anchorX: 0.5, anchorY: 0.5 }); self.maxHealth = 100; self.health = self.maxHealth; self.level = 1; self.xp = 0; self.xpToNext = 100; self.damage = 10; self.fireRate = 30; self.fireTimer = 0; self.coins = 0; self.takeDamage = function (damage) { self.health -= damage; LK.getSound('hut').play(); LK.effects.flashObject(self, 0xFF0000, 500); if (self.health <= 0) { LK.showGameOver(); } }; self.gainXP = function (amount) { self.xp += amount; while (self.xp >= self.xpToNext) { self.xp -= self.xpToNext; self.level++; self.xpToNext = self.level * 100; self.maxHealth += 20; self.health = self.maxHealth; self.damage += 5; self.fireRate = Math.max(10, self.fireRate - 2); LK.getSound('levelup').play(); LK.effects.flashScreen(0xFFFF00, 300); } }; self.update = function () { self.fireTimer--; }; return self; }); var Boss = Container.expand(function () { var self = Container.call(this); var bossGraphics = self.attachAsset('boss', { anchorX: 0.5, anchorY: 0.5 }); self.maxHealth = 500; self.health = self.maxHealth; self.speed = 1; self.xpValue = 100; self.coinChance = 1; self.powerupChance = 0.5; var healthBarBg = self.attachAsset('healthbar_bg', { anchorX: 0.5, anchorY: 0.5, y: -100 }); self.healthBarFill = self.attachAsset('healthbar_fill', { anchorX: 0, anchorY: 0.5, x: -100, y: -100 }); self.takeDamage = function (damage) { self.health -= damage; LK.effects.flashObject(self, 0xFFFFFF, 200); self.healthBarFill.scaleX = Math.max(0, self.health / self.maxHealth); if (self.health <= 0) { self.shouldDestroy = true; LK.getSound('hit').play(); } }; self.update = function () { if (bart) { var dx = bart.x - self.x; var dy = bart.y - self.y; var dist = Math.sqrt(dx * dx + dy * dy); if (dist > 0) { self.x += dx / dist * self.speed; self.y += dy / dist * self.speed; } } }; return self; }); var Bullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset('bullet', { anchorX: 0.5, anchorY: 0.5 }); self.damage = 10; self.speed = 15; self.target = null; self.lifetime = 60; self.update = function () { self.lifetime--; if (self.lifetime <= 0) { self.shouldDestroy = true; return; } if (self.target && !self.target.destroyed) { var dx = self.target.x - self.x; var dy = self.target.y - self.y; var dist = Math.sqrt(dx * dx + dy * dy); if (dist > 0) { self.x += dx / dist * self.speed; self.y += dy / dist * self.speed; } } else { self.y -= self.speed; } }; return self; }); var Coin = Container.expand(function () { var self = Container.call(this); var coinGraphics = self.attachAsset('coin', { anchorX: 0.5, anchorY: 0.5 }); self.value = 5; self.lifetime = 300; self.update = function () { self.lifetime--; if (self.lifetime <= 0) { self.shouldDestroy = true; } self.rotation += 0.05; }; return self; }); var Mutant = Container.expand(function () { var self = Container.call(this); var mutantGraphics = self.attachAsset('mutant', { anchorX: 0.5, anchorY: 0.5 }); self.maxHealth = 30; self.health = self.maxHealth; self.speed = 2; self.xpValue = 10; self.coinChance = 0.3; self.powerupChance = 0.1; self.takeDamage = function (damage) { self.health -= damage; LK.effects.flashObject(self, 0xFFFFFF, 200); if (self.health <= 0) { self.shouldDestroy = true; LK.getSound('hit').play(); } }; self.update = function () { if (bart) { var dx = bart.x - self.x; var dy = bart.y - self.y; var dist = Math.sqrt(dx * dx + dy * dy); if (dist > 0) { self.x += dx / dist * self.speed; self.y += dy / dist * self.speed; } } }; return self; }); var PowerUp = Container.expand(function () { var self = Container.call(this); var powerupGraphics = self.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); self.type = Math.random() < 0.5 ? 'damage' : 'firerate'; self.lifetime = 300; self.update = function () { self.lifetime--; if (self.lifetime <= 0) { self.shouldDestroy = true; } self.rotation += 0.03; self.y += Math.sin(LK.ticks * 0.05) * 0.5; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000080 }); /**** * Game Code ****/ var bart; var enemies = []; var bullets = []; var items = []; var wave = 1; var enemiesKilled = 0; var spawnTimer = 0; var dragTarget = null; var levelText = new Text2('Level 1', { size: 60, fill: 0xFFFFFF }); levelText.anchor.set(0, 0); levelText.x = 150; LK.gui.topLeft.addChild(levelText); var xpBarBg = LK.gui.top.attachAsset('xpbar_bg', { anchorX: 0.5, anchorY: 0, y: 10 }); var xpBarFill = LK.gui.top.attachAsset('xpbar_fill', { anchorX: 0, anchorY: 0, x: -150, y: 10, scaleX: 0 }); var coinText = new Text2('Coins: 0', { size: 50, fill: 0xFFD700 }); coinText.anchor.set(1, 0); LK.gui.topRight.addChild(coinText); var waveText = new Text2('Wave 1', { size: 80, fill: 0xFFFFFF }); waveText.anchor.set(0.5, 0.5); LK.gui.center.addChild(waveText); var scoreText = new Text2('Score: 0', { size: 60, fill: 0xFFFFFF }); scoreText.anchor.set(0.5, 1); LK.gui.bottom.addChild(scoreText); bart = game.addChild(new Bart()); bart.x = 1024; bart.y = 2000; function spawnEnemy() { var enemy; // Boss waves: 5, 10, 15, 20 if (wave % 5 === 0) { enemy = new Boss(); // Scale boss health and speed based on wave enemy.maxHealth = 500 + (wave - 5) * 200; enemy.health = enemy.maxHealth; enemy.speed = 1 + wave * 0.1; enemy.xpValue = 100 + wave * 20; } else { enemy = new Mutant(); // Progressive scaling for mutants across all 20 waves enemy.speed = 2 + wave * 0.3; enemy.maxHealth = 30 + wave * 15; enemy.health = enemy.maxHealth; enemy.xpValue = 10 + wave * 2; // Special mutant variants for higher waves if (wave >= 10) { enemy.speed += 1; enemy.maxHealth += 50; enemy.health = enemy.maxHealth; mutantGraphics = enemy.children[0]; if (mutantGraphics) { mutantGraphics.tint = 0xFF6666; // Red tint for stronger mutants } } if (wave >= 15) { enemy.speed += 1; enemy.maxHealth += 100; enemy.health = enemy.maxHealth; mutantGraphics = enemy.children[0]; if (mutantGraphics) { mutantGraphics.tint = 0xFF0000; // Dark red tint for elite mutants } } } enemy.x = Math.random() * 1848 + 100; enemy.y = -100; enemies.push(enemy); game.addChild(enemy); } function shootBullet() { if (bart.fireTimer > 0 || enemies.length === 0) return; var closestEnemy = null; var closestDist = Infinity; for (var i = 0; i < enemies.length; i++) { var dx = enemies[i].x - bart.x; var dy = enemies[i].y - bart.y; var dist = Math.sqrt(dx * dx + dy * dy); if (dist < closestDist) { closestDist = dist; closestEnemy = enemies[i]; } } if (closestEnemy && closestDist < 800) { var bullet = new Bullet(); bullet.x = bart.x; bullet.y = bart.y; bullet.target = closestEnemy; bullet.damage = bart.damage; bullets.push(bullet); game.addChild(bullet); bart.fireTimer = bart.fireRate; LK.getSound('shoot').play(); } } function spawnItem(x, y, type) { var item; if (type === 'coin') { item = new Coin(); } else { item = new PowerUp(); } item.x = x; item.y = y; items.push(item); game.addChild(item); } game.down = function (x, y, obj) { dragTarget = bart; }; game.up = function (x, y, obj) { dragTarget = null; }; game.move = function (x, y, obj) { if (dragTarget) { dragTarget.x = Math.max(60, Math.min(1988, x)); dragTarget.y = Math.max(80, Math.min(2652, y)); } }; game.update = function () { shootBullet(); spawnTimer--; if (spawnTimer <= 0) { spawnEnemy(); // Dynamic spawn rate that gets faster but never too overwhelming var baseSpawnRate = 120 - wave * 4; if (wave >= 10) baseSpawnRate -= 20; // Faster spawning for waves 10+ if (wave >= 15) baseSpawnRate -= 20; // Even faster for waves 15+ spawnTimer = Math.max(20, baseSpawnRate); } for (var i = bullets.length - 1; i >= 0; i--) { var bullet = bullets[i]; if (bullet.shouldDestroy || bullet.y < -50 || bullet.y > 2782) { bullet.destroy(); bullets.splice(i, 1); continue; } for (var j = enemies.length - 1; j >= 0; j--) { if (bullet.intersects(enemies[j])) { enemies[j].takeDamage(bullet.damage); bullet.destroy(); bullets.splice(i, 1); break; } } } for (var i = enemies.length - 1; i >= 0; i--) { var enemy = enemies[i]; if (enemy.shouldDestroy) { bart.gainXP(enemy.xpValue); LK.setScore(LK.getScore() + enemy.xpValue); scoreText.setText('Score: ' + LK.getScore()); enemiesKilled++; if (Math.random() < enemy.coinChance) { spawnItem(enemy.x, enemy.y, 'coin'); } if (Math.random() < enemy.powerupChance) { spawnItem(enemy.x, enemy.y, 'powerup'); } enemy.destroy(); enemies.splice(i, 1); // Dynamic enemy count per wave - starts at 10, increases every 5 waves var enemiesNeeded = 10 + Math.floor((wave - 1) / 5) * 5; if (enemiesKilled >= enemiesNeeded) { wave++; enemiesKilled = 0; // Check if game is completed after wave 20 if (wave > 20) { LK.showYouWin(); return; } waveText.setText('Wave ' + wave); // Special celebration for milestone waves if (wave % 5 === 0) { LK.effects.flashScreen(0xFFD700, 1000); waveText.tint = 0xFFD700; } else { waveText.tint = 0xFFFFFF; } tween(waveText, { scaleX: 2, scaleY: 2 }, { duration: 500, easing: tween.elasticOut }); tween(waveText, { scaleX: 1, scaleY: 1 }, { duration: 500, easing: tween.elasticIn }); } continue; } if (enemy.intersects(bart)) { bart.takeDamage(10); enemy.shouldDestroy = true; } if (enemy.y > 2832) { enemy.destroy(); enemies.splice(i, 1); } } for (var i = items.length - 1; i >= 0; i--) { var item = items[i]; if (item.shouldDestroy) { item.destroy(); items.splice(i, 1); continue; } if (item.intersects(bart)) { if (item instanceof Coin) { bart.coins += item.value; coinText.setText('Coins: ' + bart.coins); } else if (item instanceof PowerUp) { if (item.type === 'damage') { bart.damage += 5; } else { bart.fireRate = Math.max(5, bart.fireRate - 5); } } LK.getSound('pickup').play(); item.destroy(); items.splice(i, 1); } } levelText.setText('Level ' + bart.level); xpBarFill.scaleX = bart.xp / bart.xpToNext; }; LK.playMusic('battle');
===================================================================
--- original.js
+++ change.js
@@ -252,15 +252,42 @@
bart.x = 1024;
bart.y = 2000;
function spawnEnemy() {
var enemy;
+ // Boss waves: 5, 10, 15, 20
if (wave % 5 === 0) {
enemy = new Boss();
+ // Scale boss health and speed based on wave
+ enemy.maxHealth = 500 + (wave - 5) * 200;
+ enemy.health = enemy.maxHealth;
+ enemy.speed = 1 + wave * 0.1;
+ enemy.xpValue = 100 + wave * 20;
} else {
enemy = new Mutant();
- enemy.speed = 2 + wave * 0.2;
- enemy.maxHealth = 30 + wave * 10;
+ // Progressive scaling for mutants across all 20 waves
+ enemy.speed = 2 + wave * 0.3;
+ enemy.maxHealth = 30 + wave * 15;
enemy.health = enemy.maxHealth;
+ enemy.xpValue = 10 + wave * 2;
+ // Special mutant variants for higher waves
+ if (wave >= 10) {
+ enemy.speed += 1;
+ enemy.maxHealth += 50;
+ enemy.health = enemy.maxHealth;
+ mutantGraphics = enemy.children[0];
+ if (mutantGraphics) {
+ mutantGraphics.tint = 0xFF6666; // Red tint for stronger mutants
+ }
+ }
+ if (wave >= 15) {
+ enemy.speed += 1;
+ enemy.maxHealth += 100;
+ enemy.health = enemy.maxHealth;
+ mutantGraphics = enemy.children[0];
+ if (mutantGraphics) {
+ mutantGraphics.tint = 0xFF0000; // Dark red tint for elite mutants
+ }
+ }
}
enemy.x = Math.random() * 1848 + 100;
enemy.y = -100;
enemies.push(enemy);
@@ -319,9 +346,13 @@
shootBullet();
spawnTimer--;
if (spawnTimer <= 0) {
spawnEnemy();
- spawnTimer = Math.max(30, 120 - wave * 5);
+ // Dynamic spawn rate that gets faster but never too overwhelming
+ var baseSpawnRate = 120 - wave * 4;
+ if (wave >= 10) baseSpawnRate -= 20; // Faster spawning for waves 10+
+ if (wave >= 15) baseSpawnRate -= 20; // Even faster for waves 15+
+ spawnTimer = Math.max(20, baseSpawnRate);
}
for (var i = bullets.length - 1; i >= 0; i--) {
var bullet = bullets[i];
if (bullet.shouldDestroy || bullet.y < -50 || bullet.y > 2782) {
@@ -352,12 +383,26 @@
spawnItem(enemy.x, enemy.y, 'powerup');
}
enemy.destroy();
enemies.splice(i, 1);
- if (enemiesKilled >= wave * 10) {
+ // Dynamic enemy count per wave - starts at 10, increases every 5 waves
+ var enemiesNeeded = 10 + Math.floor((wave - 1) / 5) * 5;
+ if (enemiesKilled >= enemiesNeeded) {
wave++;
enemiesKilled = 0;
+ // Check if game is completed after wave 20
+ if (wave > 20) {
+ LK.showYouWin();
+ return;
+ }
waveText.setText('Wave ' + wave);
+ // Special celebration for milestone waves
+ if (wave % 5 === 0) {
+ LK.effects.flashScreen(0xFFD700, 1000);
+ waveText.tint = 0xFFD700;
+ } else {
+ waveText.tint = 0xFFFFFF;
+ }
tween(waveText, {
scaleX: 2,
scaleY: 2
}, {
Bart holding a slingshot. In-Game asset. 2d. High contrast. No shadows
Alien mutant from the Simpsons. In-Game asset. 2d. High contrast. No shadows
Make my character purple
Krusty Burger. In-Game asset. 2d. High contrast. No shadows
Remove Krusty burger
Make my character red
Make my character turquoise and make him hold a bowling ball
Bart holding a plasma gun. In-Game asset. 2d. High contrast. No shadows
Bart holding a shotgun with 2 duck heads instead of barrels and make sure that Bart's body is fully visible In-Game asset. 2d. High contrast. No shadows
Bart in a fighting pose with a flower's head in his shirt. In-Game asset. 2d. High contrast. No shadows
Plasma projectile. In-Game asset. 2d. High contrast. No shadows
Red bowling ball. In-Game asset. 2d. High contrast. No shadows
Santa's Little Helper the Simpsons In-Game asset. 2d. High contrast. No shadows
Make my character have White Classical hair and make him hold a poem
Make my character orange, have a chef's hat and make him hold some Alien Jelly
Alien food: Some green, oozing jelly and some purple shrimp with blue Human eyes all on a plate In-Game asset. 2d. High contrast. No shadows.
Bart holding a light brown slingshot shaped like a peanut. Make him be in a fighting stance In-Game asset. 2d. High contrast. No shadows
Bart holding a purple Spraycan while he is wearing purple shoes and shorts. Show all of his body in a fighting stance In-Game asset. 2d. High contrast. No shadows
Peanut. In-Game asset. 2d. High contrast. No shadows
Chestnut. In-Game asset. 2d. High contrast. No shadows
Add outlines
Make my character dark yellow and have a red samurai helmet
Katana. In-Game asset. 2d. High contrast. No shadows
Make my character have more tentacle based hands and make him have dark black hair with a ponytail (make my character's background white)
Make my character have cute white hair and make him hold a microphone
Make my character pink and make him have rock hair and a rock guitar
Make my character have a brown mustache, hold a gun and have a sergeant's hat
Bart is tired. In-Game asset. 2d. High contrast. No shadows
Bullet. In-Game asset. 2d. High contrast. No shadows
Topdown stageplay design no instruments or crowd, only the base. In-Game asset. 2d. High contrast. No shadows
Bart holding a toy bow and has a quiver full of toy arrows. In-Game asset. 2d. High contrast. No shadows
Bart holding a pot with a plant and is about to throw it. In-Game asset. 2d. High contrast. No shadows
Potted plant. In-Game asset. 2d. High contrast. No shadows
Pottery sherd. In-Game asset. 2d. High contrast. No shadows
Make my character inside an UFO armed with a laser cannon and make him drive it
Itchy's head. In-Game asset. 2d. High contrast. No shadows. Simpsons
Scratchy's head. In-Game asset. 2d. High contrast. No shadows. Simpsons
Itchy and scratchy show!. In-Game asset. 2d. High contrast. No shadows