User prompt
Add a title at left top corner saying Tower Of End
User prompt
nono i want the background to show my image, not colour
User prompt
i just added the image but the background is still white
User prompt
can you change the background? black is very weird
User prompt
take out the life bar and lifes, and make sure the game ends and shows a restart option when the hero gets hit by a bomb
User prompt
seems like it does not work, the game is not ending
User prompt
make it so when the hero gets hit by 1 bomb it displays game over and shows an option fore restart
User prompt
make sure the hero loses a life when he gets hit by a bomb from the goblin , and showcase the lifebars at the top corner
User prompt
make it so the hero has 3 lifes per round and if you get hit by 1 bomb you lose 1 life
User prompt
do that for me please
User prompt
when the monsters spawn , make them spawn in random locations, and add a spawn effect to them
User prompt
make it so its only 10 monsters per wave and the only spam after killing them
User prompt
make it so when i move the mouse , the hero moves so i can target the bullets
User prompt
what about animations
User prompt
add a damage meter when someone shoots a monsters, add, a level at the top showcasing what level are you on.
User prompt
the monsters keep on coming down, make them stay in one place after they spawn
User prompt
can you make it so the another wave spawns after killing 5 monsters and it will be 10, then double and so on, making the game harder
User prompt
can you implement them for me
Initial prompt
Dungeon Loop
/**** * Classes ****/ // Bomb class var Bomb = Container.expand(function () { var self = Container.call(this); var bombGraphics = self.attachAsset('bomb', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.y += self.speed; }; }); // Bullet class var Bullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset('bullet', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 15; self.update = function () { self.y -= self.speed; }; }); // Enemy class var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.health = 100; // Initialize health for the enemy self.update = function () { // Monsters stay in place after they spawn // Throw bomb at hero if (LK.ticks % 120 == 0) { // Throw a bomb every 2 seconds var bomb = new Bomb(); bomb.x = self.x; bomb.y = self.y; game.addChild(bomb); } }; self.damage = function (amount) { // Function to apply damage to the enemy self.health -= amount; if (self.health <= 0) { self.destroy(); // Destroy the enemy if health is 0 or less } }; }); //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Hero class var Hero = Container.expand(function () { var self = Container.call(this); var heroGraphics = self.attachAsset('hero', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 10; self.update = function () { // Hero update logic }; self.damage = function () { LK.showGameOver(); }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ var background = game.attachAsset('background', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); // Initialize hero var hero = game.addChild(new Hero()); hero.x = 2048 / 2; hero.y = 2732 - 200; // Initialize enemies var enemies = []; for (var i = 0; i < 5; i++) { var enemy = new Enemy(); enemy.x = Math.random() * 2048; enemy.y = Math.random() * 1000; enemies.push(enemy); game.addChild(enemy); // Add spawn effect to the enemy LK.effects.flashObject(enemy, 0xFFFFFF, 500); } // Initialize bullets var bullets = []; // Initialize enemies killed count var enemiesKilled = 0; // Initialize current wave var currentWave = 0; // Initialize level var level = 1; // Create game title var gameTitle = new Text2('Tower Of End', { size: 50, fill: 0xFFFFFF }); gameTitle.anchor.set(0, 0); LK.gui.topLeft.addChild(gameTitle); // Create level display var levelDisplay = new Text2('Level: ' + level, { size: 50, fill: 0xFFFFFF }); levelDisplay.anchor.set(0.5, 0); LK.gui.top.addChild(levelDisplay); // Game update logic game.update = function () { // Update hero hero.update(); // Define waves var waves = [{ count: 5, type: 'enemy', speed: 5 }, { count: 10, type: 'enemy', speed: 7 }, { count: 15, type: 'enemy', speed: 10 }]; var currentWave = 0; var enemiesToSpawn = waves[currentWave].count; // Update enemies for (var i = enemies.length - 1; i >= 0; i--) { enemies[i].update(); if (enemies[i].y > 2732) { enemies[i].destroy(); enemies.splice(i, 1); } } // Spawn new enemies if (enemies.length == 0) { enemiesToSpawn = 10; for (var i = 0; i < enemiesToSpawn; i++) { var enemy = new Enemy(); enemy.speed = waves[currentWave].speed; enemy.x = Math.random() * 2048; enemy.y = Math.random() * 1000; enemies.push(enemy); game.addChild(enemy); // Add spawn effect to the enemy LK.effects.flashObject(enemy, 0xFFFFFF, 500); } currentWave++; level++; // Increase the level levelDisplay.setText('Level: ' + level); // Update the level display } // Update bullets for (var j = bullets.length - 1; j >= 0; j--) { bullets[j].update(); if (bullets[j].y < 0) { bullets[j].destroy(); bullets.splice(j, 1); } } // Collision detection for (var k = bullets.length - 1; k >= 0; k--) { for (var l = enemies.length - 1; l >= 0; l--) { if (bullets[k].intersects(enemies[l])) { bullets[k].destroy(); bullets.splice(k, 1); enemies[l].destroy(); enemies.splice(l, 1); enemiesKilled++; break; } } } }; // Handle game input game.down = function (x, y, obj) { var bullet = new Bullet(); bullet.x = hero.x; bullet.y = hero.y; bullets.push(bullet); game.addChild(bullet); // Add flash effect to hero when shooting LK.effects.flashObject(hero, 0xFFFFFF, 100); }; game.move = function (x, y, obj) { hero.x = x; hero.y = y; }; // Collision detection for bombs and hero for (var i = game.children.length - 1; i >= 0; i--) { var child = game.children[i]; if (child instanceof Bomb && child.intersects(hero)) { child.destroy(); LK.showGameOver(); } }
===================================================================
--- original.js
+++ change.js
@@ -109,8 +109,15 @@
// Initialize current wave
var currentWave = 0;
// Initialize level
var level = 1;
+// Create game title
+var gameTitle = new Text2('Tower Of End', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+gameTitle.anchor.set(0, 0);
+LK.gui.topLeft.addChild(gameTitle);
// Create level display
var levelDisplay = new Text2('Level: ' + level, {
size: 50,
fill: 0xFFFFFF
2d pixel goblin. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
create me a dark 2d pixel arrow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
create me a 2d pixel dark archer. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
create me a 2d pixel bomb. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
create me a 2d pixel dark dungeon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gold coin 2d pixel. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
create me a big furious goblin with armor 2d and pixel. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
create a 2d pixel healthbar. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.