User prompt
Give the monsters a kill box and give the character a hit box
User prompt
Move the code button under coins, counter bar thing
User prompt
Makes a code thing I meant to say button that you can click, and you can use codes to get more money and guns you can choose what the codes are and tell mm
User prompt
Make this a online game with friendly fire
User prompt
When going to shop make a gun selection menu or buy menu to select or buy a weapon and instead of having enough money not going to a menu in the buying it make it if you have zero ten thousand one million dollars you can still use the shop
User prompt
Go to a gun selection menu when he goes to the shop instead of just having enough for the shop
User prompt
Give the character gun when he buys it
User prompt
Make the character faster
User prompt
Move the timer 10 cm up
User prompt
Move the time counter a little bit up
User prompt
Move the time counter at the middle bottom
User prompt
Move the queen bar at the middle top and move the time bar at the middle bottom
User prompt
Make the time bar seeable
User prompt
Make the shop work and have guns inside
User prompt
Make it more fast and put a speed button that let you sprint and it has limited stamina in when you use it all to get 10 coins to refill it
User prompt
Make the character a little bit faster
User prompt
Stop the character from teleporting when the someone is on the iPad and click the screen, make it walk there or run put a run button
User prompt
Put a pause button to pause. The game and unpause button is what the pause button into when you click it.
User prompt
And make the word coins seeable
User prompt
And don’t put the coins and tire bar in the same spot
User prompt
Make a shop where you can buy things with the money and the money can stack up and put a timer for how long you survived
User prompt
Make a shop to use the money on and the money stacks and it’s a online game that that has friendly fire
User prompt
Please fix the bug: 'ReferenceError: Can't find variable: friendlyFireEnabled' in or related to this line: 'if (friendlyFireEnabled) {' Line Number: 135
User prompt
Make the enemies follow the player and also make an online game and there’s friendly fire, and the stronger the monsters are the slower they are and some have armor and some of them are different. Some of them are not.
Code edit (1 edits merged)
Please save this source code
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1", { coins: 0, weaponLevel: 0 }); /**** * Classes ****/ var Character = Container.expand(function () { var self = Container.call(this); var characterGraphics = self.attachAsset('character', { anchorX: 0.5, anchorY: 0.5 }); self.down = function (x, y, obj) { dragNode = self; handleMove(x, y, obj); }; self.up = function (x, y, obj) { dragNode = null; }; return self; }); var Coin = Container.expand(function () { var self = Container.call(this); var coinGraphics = self.attachAsset('coin', { anchorX: 0.5, anchorY: 0.5 }); return self; }); var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5 }); self.health = 3; // Example health value self.speed = 2 / self.health; // The stronger the enemy, the slower it moves self.update = function () { // Example enemy movement logic // Calculate direction towards the character var dx = character.x - self.x; var dy = character.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); // Normalize direction and move towards the character if (distance > 0) { self.x += dx / distance * self.speed; self.y += dy / distance * self.speed; } }; self.armor = Math.random() > 0.5 ? 1 : 0; // 50% chance to have armor return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Initialize assets used in this game. Scale them according to what is needed for the game. game.setBackgroundColor(0x008080); var character = game.addChild(new Character()); character.x = 1024; character.y = 1366; var coins = []; var enemies = []; var dragNode = null; var friendlyFireEnabled = false; // Initialize friendlyFireEnabled variable var scoreTxt = new Text2('Coins: ' + storage.coins, { size: 100, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); function handleMove(x, y, obj) { if (dragNode) { dragNode.x = x; dragNode.y = y; } } game.move = handleMove; game.down = function (x, y, obj) { dragNode = character; handleMove(x, y, obj); }; game.up = function (x, y, obj) { dragNode = null; }; game.update = function () { if (LK.ticks % 60 == 0) { var newCoin = new Coin(); newCoin.x = Math.random() * 2048; newCoin.y = Math.random() * 2732; coins.push(newCoin); game.addChild(newCoin); } if (LK.ticks % 120 == 0) { var newEnemy = new Enemy(); newEnemy.x = Math.random() * 2048; newEnemy.y = 0; enemies.push(newEnemy); game.addChild(newEnemy); } for (var i = coins.length - 1; i >= 0; i--) { if (character.intersects(coins[i])) { storage.coins += 1; scoreTxt.setText('Coins: ' + storage.coins); LK.getSound('coinCollect').play(); coins[i].destroy(); coins.splice(i, 1); } } for (var j = enemies.length - 1; j >= 0; j--) { enemies[j].update(); if (character.intersects(enemies[j])) { if (friendlyFireEnabled) { // Logic for friendly fire damage character.health -= 1; if (character.health <= 0) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } } else { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } } if (enemies[j].health <= 0) { storage.coins += 5; scoreTxt.setText('Coins: ' + storage.coins); LK.getSound('enemyDefeat').play(); enemies[j].destroy(); enemies.splice(j, 1); } } }; LK.playMusic('backgroundMusic');
===================================================================
--- original.js
+++ change.js
@@ -74,8 +74,9 @@
character.y = 1366;
var coins = [];
var enemies = [];
var dragNode = null;
+var friendlyFireEnabled = false; // Initialize friendlyFireEnabled variable
var scoreTxt = new Text2('Coins: ' + storage.coins, {
size: 100,
fill: 0xFFFFFF
});
Make it look like a shop. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
A scary zombie. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
A realistic coin. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
A running man running for his life. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
A house. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Zombie apocalypse city. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows