User prompt
Make the 5 boss little harder
User prompt
Make the 5 boss little less hard
User prompt
Make the 4 and 5 bosses less hard
User prompt
Make the 3 boss less hard
User prompt
Start the game music
User prompt
Make a sound bullet for the five bosses
User prompt
Make a sound bullet for every enemy
User prompt
No, superman go and take it, but it like a green thing, 2 cure every round
User prompt
Make it visible.
User prompt
Ok, Make it appear only in the case when Superman merges.
User prompt
No, superman go and take it, but it like a green thing, 2 cure every round
User prompt
Add the cure after the superman gets hit
User prompt
Make there be a cure after Superman merges.
User prompt
Every enemy has a different bullet
User prompt
Perfect, Now, make the game increase in difficulty as the rounds progress And make the enemy move more actively. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make the enemies stronger, and have them shoot directly at Superman.
User prompt
More details sky
User prompt
Add a sky night
Code edit (1 edits merged)
Please save this source code
User prompt
Superman: Sky Defender
Initial prompt
The game is in horizontal (landscape)...The game is about Superman. He flies through the city skies, shooting heat vision from his eyes and battling enemies in front of him. The player must avoid enemy attacks and projectiles. Controls are smooth and intuitive: touching and dragging on the screen moves Superman in any direction). The game consists of five rounds, each featuring a different enemy. With every new round, the enemy becomes stronger and more challenging.
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Building = Container.expand(function () { var self = Container.call(this); var buildingGraphics = self.attachAsset('cityBuilding', { anchorX: 0.5, anchorY: 1.0 }); return self; }); var Enemy = Container.expand(function (enemyType) { var self = Container.call(this); var enemyGraphics = self.attachAsset(enemyType, { anchorX: 0.5, anchorY: 0.5 }); // Set health and damage based on enemy type switch (enemyType) { case 'enemy1': self.health = 40; self.damage = 10; self.shootDelay = 90; // 1.5 seconds break; case 'enemy2': self.health = 60; self.damage = 15; self.shootDelay = 75; // 1.25 seconds break; case 'enemy3': self.health = 80; self.damage = 20; self.shootDelay = 60; // 1 second break; case 'enemy4': self.health = 100; self.damage = 25; self.shootDelay = 45; // 0.75 seconds break; case 'enemy5': self.health = 120; self.damage = 30; self.shootDelay = 30; // 0.5 seconds break; } self.maxHealth = self.health; self.shootTimer = 0; self.moveDirection = 1; self.speed = 2; self.takeDamage = function (damage) { self.health -= damage; LK.effects.flashObject(self, 0xffffff, 200); if (self.health <= 0) { self.health = 0; return true; // Enemy destroyed } return false; }; self.update = function () { // Move enemy in a pattern self.y += self.moveDirection * self.speed; if (self.y < 200 || self.y > 1500) { self.moveDirection *= -1; } // Shoot at Superman self.shootTimer++; if (self.shootTimer >= self.shootDelay) { self.shootTimer = 0; self.shoot(); } }; self.shoot = function () { var bullet = new EnemyBullet(); bullet.x = self.x - 50; bullet.y = self.y; bullet.damage = self.damage; enemyBullets.push(bullet); game.addChild(bullet); LK.getSound('enemyShoot').play(); }; return self; }); var EnemyBullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset('enemyBullet', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -8; self.damage = 10; self.update = function () { self.x += self.speed; }; return self; }); var HeatVision = Container.expand(function () { var self = Container.call(this); var heatGraphics = self.attachAsset('heatVision', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 15; self.damage = 20; self.update = function () { self.x += self.speed; }; return self; }); var Superman = Container.expand(function () { var self = Container.call(this); var supermanGraphics = self.attachAsset('superman', { anchorX: 0.5, anchorY: 0.5 }); self.health = 100; self.maxHealth = 100; self.shootCooldown = 0; self.invulnerable = false; self.invulnerableTime = 0; self.takeDamage = function (damage) { if (self.invulnerable) return; self.health -= damage; self.invulnerable = true; self.invulnerableTime = 60; // 1 second at 60fps // Flash red when taking damage LK.effects.flashObject(self, 0xff0000, 500); LK.getSound('hit').play(); if (self.health <= 0) { self.health = 0; gameOver = true; } }; self.update = function () { if (self.shootCooldown > 0) { self.shootCooldown--; } if (self.invulnerableTime > 0) { self.invulnerableTime--; if (self.invulnerableTime <= 0) { self.invulnerable = false; } } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87ceeb }); /**** * Game Code ****/ var superman = null; var heatVisionBeams = []; var enemies = []; var enemyBullets = []; var buildings = []; var currentRound = 1; var maxRounds = 5; var gameOver = false; var roundComplete = false; var dragNode = null; // Enemy types for each round var enemyTypes = ['enemy1', 'enemy2', 'enemy3', 'enemy4', 'enemy5']; // Create city background for (var i = 0; i < 12; i++) { var building = new Building(); building.x = i * 180; building.y = 2732; building.alpha = 0.3; buildings.push(building); game.addChild(building); } // Create Superman superman = new Superman(); superman.x = 300; superman.y = 1366; game.addChild(superman); // Create UI elements var roundText = new Text2('Round: 1', { size: 60, fill: 0xFFFFFF }); roundText.anchor.set(0.5, 0); LK.gui.top.addChild(roundText); var healthText = new Text2('Health: 100', { size: 50, fill: 0xFFFFFF }); healthText.anchor.set(0, 0); healthText.x = 120; healthText.y = 10; LK.gui.topLeft.addChild(healthText); var scoreText = new Text2('Score: 0', { size: 50, fill: 0xFFFFFF }); scoreText.anchor.set(1, 0); LK.gui.topRight.addChild(scoreText); // Start first round function startRound() { if (currentRound > maxRounds) { LK.showYouWin(); return; } roundComplete = false; var enemy = new Enemy(enemyTypes[currentRound - 1]); enemy.x = 1800; enemy.y = 800; enemies.push(enemy); game.addChild(enemy); roundText.setText('Round: ' + currentRound); } // Touch controls game.down = function (x, y, obj) { dragNode = superman; superman.x = x; superman.y = y; // Shoot heat vision if (superman.shootCooldown <= 0) { var beam = new HeatVision(); beam.x = superman.x + 40; beam.y = superman.y; heatVisionBeams.push(beam); game.addChild(beam); superman.shootCooldown = 15; // 0.25 seconds LK.getSound('shoot').play(); } }; game.move = function (x, y, obj) { if (dragNode) { dragNode.x = x; dragNode.y = y; } }; game.up = function (x, y, obj) { dragNode = null; }; // Initialize first round startRound(); game.update = function () { if (gameOver) { LK.showGameOver(); return; } // Update health display healthText.setText('Health: ' + superman.health); scoreText.setText('Score: ' + LK.getScore()); // Check if round is complete if (enemies.length === 0 && !roundComplete) { roundComplete = true; currentRound++; LK.setTimeout(function () { startRound(); }, 2000); } // Update heat vision beams for (var i = heatVisionBeams.length - 1; i >= 0; i--) { var beam = heatVisionBeams[i]; // Remove if off screen if (beam.x > 2100) { beam.destroy(); heatVisionBeams.splice(i, 1); continue; } // Check collision with enemies for (var j = enemies.length - 1; j >= 0; j--) { var enemy = enemies[j]; if (beam.intersects(enemy)) { var destroyed = enemy.takeDamage(beam.damage); beam.destroy(); heatVisionBeams.splice(i, 1); if (destroyed) { LK.setScore(LK.getScore() + 100); enemy.destroy(); enemies.splice(j, 1); } break; } } } // Update enemy bullets for (var i = enemyBullets.length - 1; i >= 0; i--) { var bullet = enemyBullets[i]; // Remove if off screen if (bullet.x < -100) { bullet.destroy(); enemyBullets.splice(i, 1); continue; } // Check collision with Superman if (bullet.intersects(superman)) { superman.takeDamage(bullet.damage); bullet.destroy(); enemyBullets.splice(i, 1); } } // Keep Superman within bounds if (superman.x < 40) superman.x = 40; if (superman.x > 2008) superman.x = 2008; if (superman.y < 60) superman.y = 60; if (superman.y > 2672) superman.y = 2672; };
===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,312 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+var Building = Container.expand(function () {
+ var self = Container.call(this);
+ var buildingGraphics = self.attachAsset('cityBuilding', {
+ anchorX: 0.5,
+ anchorY: 1.0
+ });
+ return self;
+});
+var Enemy = Container.expand(function (enemyType) {
+ var self = Container.call(this);
+ var enemyGraphics = self.attachAsset(enemyType, {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ // Set health and damage based on enemy type
+ switch (enemyType) {
+ case 'enemy1':
+ self.health = 40;
+ self.damage = 10;
+ self.shootDelay = 90; // 1.5 seconds
+ break;
+ case 'enemy2':
+ self.health = 60;
+ self.damage = 15;
+ self.shootDelay = 75; // 1.25 seconds
+ break;
+ case 'enemy3':
+ self.health = 80;
+ self.damage = 20;
+ self.shootDelay = 60; // 1 second
+ break;
+ case 'enemy4':
+ self.health = 100;
+ self.damage = 25;
+ self.shootDelay = 45; // 0.75 seconds
+ break;
+ case 'enemy5':
+ self.health = 120;
+ self.damage = 30;
+ self.shootDelay = 30; // 0.5 seconds
+ break;
+ }
+ self.maxHealth = self.health;
+ self.shootTimer = 0;
+ self.moveDirection = 1;
+ self.speed = 2;
+ self.takeDamage = function (damage) {
+ self.health -= damage;
+ LK.effects.flashObject(self, 0xffffff, 200);
+ if (self.health <= 0) {
+ self.health = 0;
+ return true; // Enemy destroyed
+ }
+ return false;
+ };
+ self.update = function () {
+ // Move enemy in a pattern
+ self.y += self.moveDirection * self.speed;
+ if (self.y < 200 || self.y > 1500) {
+ self.moveDirection *= -1;
+ }
+ // Shoot at Superman
+ self.shootTimer++;
+ if (self.shootTimer >= self.shootDelay) {
+ self.shootTimer = 0;
+ self.shoot();
+ }
+ };
+ self.shoot = function () {
+ var bullet = new EnemyBullet();
+ bullet.x = self.x - 50;
+ bullet.y = self.y;
+ bullet.damage = self.damage;
+ enemyBullets.push(bullet);
+ game.addChild(bullet);
+ LK.getSound('enemyShoot').play();
+ };
+ return self;
+});
+var EnemyBullet = Container.expand(function () {
+ var self = Container.call(this);
+ var bulletGraphics = self.attachAsset('enemyBullet', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = -8;
+ self.damage = 10;
+ self.update = function () {
+ self.x += self.speed;
+ };
+ return self;
+});
+var HeatVision = Container.expand(function () {
+ var self = Container.call(this);
+ var heatGraphics = self.attachAsset('heatVision', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 15;
+ self.damage = 20;
+ self.update = function () {
+ self.x += self.speed;
+ };
+ return self;
+});
+var Superman = Container.expand(function () {
+ var self = Container.call(this);
+ var supermanGraphics = self.attachAsset('superman', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.health = 100;
+ self.maxHealth = 100;
+ self.shootCooldown = 0;
+ self.invulnerable = false;
+ self.invulnerableTime = 0;
+ self.takeDamage = function (damage) {
+ if (self.invulnerable) return;
+ self.health -= damage;
+ self.invulnerable = true;
+ self.invulnerableTime = 60; // 1 second at 60fps
+ // Flash red when taking damage
+ LK.effects.flashObject(self, 0xff0000, 500);
+ LK.getSound('hit').play();
+ if (self.health <= 0) {
+ self.health = 0;
+ gameOver = true;
+ }
+ };
+ self.update = function () {
+ if (self.shootCooldown > 0) {
+ self.shootCooldown--;
+ }
+ if (self.invulnerableTime > 0) {
+ self.invulnerableTime--;
+ if (self.invulnerableTime <= 0) {
+ self.invulnerable = false;
+ }
+ }
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x87ceeb
+});
+
+/****
+* Game Code
+****/
+var superman = null;
+var heatVisionBeams = [];
+var enemies = [];
+var enemyBullets = [];
+var buildings = [];
+var currentRound = 1;
+var maxRounds = 5;
+var gameOver = false;
+var roundComplete = false;
+var dragNode = null;
+// Enemy types for each round
+var enemyTypes = ['enemy1', 'enemy2', 'enemy3', 'enemy4', 'enemy5'];
+// Create city background
+for (var i = 0; i < 12; i++) {
+ var building = new Building();
+ building.x = i * 180;
+ building.y = 2732;
+ building.alpha = 0.3;
+ buildings.push(building);
+ game.addChild(building);
+}
+// Create Superman
+superman = new Superman();
+superman.x = 300;
+superman.y = 1366;
+game.addChild(superman);
+// Create UI elements
+var roundText = new Text2('Round: 1', {
+ size: 60,
+ fill: 0xFFFFFF
+});
+roundText.anchor.set(0.5, 0);
+LK.gui.top.addChild(roundText);
+var healthText = new Text2('Health: 100', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+healthText.anchor.set(0, 0);
+healthText.x = 120;
+healthText.y = 10;
+LK.gui.topLeft.addChild(healthText);
+var scoreText = new Text2('Score: 0', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+scoreText.anchor.set(1, 0);
+LK.gui.topRight.addChild(scoreText);
+// Start first round
+function startRound() {
+ if (currentRound > maxRounds) {
+ LK.showYouWin();
+ return;
+ }
+ roundComplete = false;
+ var enemy = new Enemy(enemyTypes[currentRound - 1]);
+ enemy.x = 1800;
+ enemy.y = 800;
+ enemies.push(enemy);
+ game.addChild(enemy);
+ roundText.setText('Round: ' + currentRound);
+}
+// Touch controls
+game.down = function (x, y, obj) {
+ dragNode = superman;
+ superman.x = x;
+ superman.y = y;
+ // Shoot heat vision
+ if (superman.shootCooldown <= 0) {
+ var beam = new HeatVision();
+ beam.x = superman.x + 40;
+ beam.y = superman.y;
+ heatVisionBeams.push(beam);
+ game.addChild(beam);
+ superman.shootCooldown = 15; // 0.25 seconds
+ LK.getSound('shoot').play();
+ }
+};
+game.move = function (x, y, obj) {
+ if (dragNode) {
+ dragNode.x = x;
+ dragNode.y = y;
+ }
+};
+game.up = function (x, y, obj) {
+ dragNode = null;
+};
+// Initialize first round
+startRound();
+game.update = function () {
+ if (gameOver) {
+ LK.showGameOver();
+ return;
+ }
+ // Update health display
+ healthText.setText('Health: ' + superman.health);
+ scoreText.setText('Score: ' + LK.getScore());
+ // Check if round is complete
+ if (enemies.length === 0 && !roundComplete) {
+ roundComplete = true;
+ currentRound++;
+ LK.setTimeout(function () {
+ startRound();
+ }, 2000);
+ }
+ // Update heat vision beams
+ for (var i = heatVisionBeams.length - 1; i >= 0; i--) {
+ var beam = heatVisionBeams[i];
+ // Remove if off screen
+ if (beam.x > 2100) {
+ beam.destroy();
+ heatVisionBeams.splice(i, 1);
+ continue;
+ }
+ // Check collision with enemies
+ for (var j = enemies.length - 1; j >= 0; j--) {
+ var enemy = enemies[j];
+ if (beam.intersects(enemy)) {
+ var destroyed = enemy.takeDamage(beam.damage);
+ beam.destroy();
+ heatVisionBeams.splice(i, 1);
+ if (destroyed) {
+ LK.setScore(LK.getScore() + 100);
+ enemy.destroy();
+ enemies.splice(j, 1);
+ }
+ break;
+ }
+ }
+ }
+ // Update enemy bullets
+ for (var i = enemyBullets.length - 1; i >= 0; i--) {
+ var bullet = enemyBullets[i];
+ // Remove if off screen
+ if (bullet.x < -100) {
+ bullet.destroy();
+ enemyBullets.splice(i, 1);
+ continue;
+ }
+ // Check collision with Superman
+ if (bullet.intersects(superman)) {
+ superman.takeDamage(bullet.damage);
+ bullet.destroy();
+ enemyBullets.splice(i, 1);
+ }
+ }
+ // Keep Superman within bounds
+ if (superman.x < 40) superman.x = 40;
+ if (superman.x > 2008) superman.x = 2008;
+ if (superman.y < 60) superman.y = 60;
+ if (superman.y > 2672) superman.y = 2672;
+};
\ No newline at end of file
Superman 2d game. In-Game asset. 2d. High contrast. No shadows
City building 2d game long and grey with windows. In-Game asset. 2d. High contrast
Aggressive strong big robot 2d game right side. In-Game asset. 2d. High contrast. No shadows
Mad strong person like the joker 2d game. In-Game asset. 2d. High contrast. No shadows
Savage alien strong 2d game. In-Game asset. 2d. High contrast. No shadows
Mad strong wizard dc world 2d game. In-Game asset. 2d. High contrast. No shadows
Dark superman 2d game. In-Game asset. 2d. High contrast. No shadows
Robot bullet 2d game. In-Game asset. 2d. High contrast. No shadows
Knife 2d game. In-Game asset. 2d. High contrast. No shadows
Thunder 2d game. In-Game asset. 2d. High contrast. No shadows
Superhero heal. In-Game asset. 2d. High contrast. No shadows