User prompt
Создать оделный бот бес функций "х4"
User prompt
Создать "бос55"
User prompt
Бот55 поставить по середине экрана
User prompt
Создать "бот55"
User prompt
Когда поевляеца эффект зрыва бот88 звук z2
User prompt
Когда умерает бот88 звук z2
User prompt
При нажатие по бот88 звук z1
User prompt
Добавить "босс33" передвигается зигзагом атакует, воздушные шары уменьшая на -3 балла
User prompt
До 71 спав "бос33" (задача с1 уничтожить все воздушные шоры) (задача с2 если нажать на нево рас 25 он умрет. не может снова спав когда бос33 умер
User prompt
Фон с2 растянуть на весь экран
User prompt
При 70 баллов создать "фон с2" крайне плавно.
User prompt
(Задача 5 При эффект взрыв бот88 падает внимание и унечтожаеца)
User prompt
Эффект взрыв бот88 зделать больше в 5 раз
User prompt
Убрать победу на 80 баллов. Поставить победа на 101 баллов
User prompt
(Задача 4, Бот88 при нажатия 15 рас по нему выполняет задачу 2)
User prompt
Кнопка0 поставить чуть ниже
User prompt
Создать "кнопку0" каторая при нажатие дает 55 баллов
User prompt
Бот88 (Задача 3. Передвигаться по середине экрана слева на права и повторно пока не нажмут на бот88 15 раз
User prompt
Бот88 (задача 1. Создает бота11 внутри себя каждый 10 сикунд, не больше 1) (задача 2. Если ножать 15 раз, по бот88 создает 1 взрыв внутри себя. быстра падает вниз когда зайдет до низа умерает.)
User prompt
Добавить кнопку каторая выключает музыку
User prompt
Бот88 спавн внутри себя бот11 каждый 10 сикунд
User prompt
Спав бот11 каждый через 10 сикунд.
User prompt
Бот88 спав внутри себя бот11
User prompt
Бот11 нет спавн
User prompt
Спавн бот11 внутри бот88
/**** * Classes ****/ // Assets will be automatically created and loaded during gameplay // Balloon class var Balloon = Container.expand(function () { var self = Container.call(this); var balloonGraphics = self.attachAsset('balloon', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 2; self.update = function () { if (LK.getScore() >= 20) { self.speed = 4; } self.y += self.speed; if (self.y < self.height / 2) { self.y = self.height / 2; } if (self.x < self.width / 2) { self.x = self.width / 2; } if (self.x > 2048 - self.width / 2) { self.x = 2048 - self.width / 2; } if (self.y > 2732 - self.height / 2) { self.y = 2732 - self.height / 2; self.speed = 0; LK.setScore(LK.getScore() - 1); scoreTxt.setText(LK.getScore()); self.destroy(); if (miniFriend && miniFriend.intersects(self)) { // No score increment when mini friend intersects balloon } } // Check if balloon is close to any explosion and avoid it for (var i = 0; i < explosions.length; i++) { var explosion = explosions[i]; if (Math.abs(self.x - explosion.x) < 100 && Math.abs(self.y - explosion.y) < 100) { self.x += self.x - explosion.x > 0 ? 5 : -5; self.y += self.y - explosion.y > 0 ? 5 : -5; self.y -= 10; // Push balloon upwards if close to explosion } // Push balloon away from expanding explosion if (Math.abs(self.x - explosion.x) < 200 && Math.abs(self.y - explosion.y) < 200) { self.x += self.x - explosion.x > 0 ? 2 : -2; self.y += self.y - explosion.y > 0 ? 2 : -2; } } // Removed unnecessary destruction of balloons when they go off the screen }; self.down = function (x, y, obj) { self.pop(); }; self.pop = function () { LK.setScore(LK.getScore() + 1); scoreTxt.setText(LK.getScore()); LK.getSound('rubbish').play(); for (var i = balloons.length - 1; i >= 0; i--) { if (balloons[i].y > 2732 - balloons[i].height / 2) { balloons.splice(i, 1); } } for (var i = balloons.length - 1; i >= 0; i--) { if (balloons[i].y > 2732 - balloons[i].height / 2) { balloons.splice(i, 1); } } // Create explosion effect var explosion = LK.getAsset('explosion', { anchorX: 0.5, anchorY: 0.5, x: self.x, y: self.y }); // Check if balloon is close enough to the explosion if (Math.abs(self.x - explosion.x) < 100 && Math.abs(self.y - explosion.y) < 100) { self.y -= 10; // Push balloon upwards if close to explosion // Create explosion effect var explosion = LK.getAsset('explosion', { anchorX: 0.5, anchorY: 0.5, x: self.x, y: self.y }); game.addChild(explosion); explosions.push(explosion); expandExplosion(explosion); LK.setTimeout(function () { explosion.destroy(); var index = explosions.indexOf(explosion); if (index > -1) { explosions.splice(index, 1); } }, 3000); LK.effects.flashObject(explosion, 0xff0000, 500); // Flash red for 500ms // Push all nearby balloons for (var i = 0; i < balloons.length; i++) { var balloon = balloons[i]; if (Math.abs(balloon.x - explosion.x) < 200 && Math.abs(balloon.y - explosion.y) < 200) { balloon.x += balloon.x - explosion.x > 0 ? 10 : -10; balloon.y += balloon.y - explosion.y > 0 ? 10 : -10; } } } LK.getSound('rubbish').play(); self.destroy(); if (LK.getScore() < 0) { LK.showGameOver(); } }; }); var Bot11 = Container.expand(function () { var self = Container.call(this); var botGraphics = self.attachAsset('bot11', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 2; self.update = function () { self.y += self.speed; if (self.y > 2732) { self.destroy(); } }; }); var Bot88 = Container.expand(function () { var self = Container.call(this); var botGraphics = self.attachAsset('bot88', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 3; self.clickCount = 0; self.bot11Spawned = false; self.update = function () { // Move horizontally across the screen self.x += self.speed; if (self.x > 2048 - self.width / 2 || self.x < self.width / 2) { self.speed = -self.speed; // Reverse direction when hitting screen edges } }; self.down = function (x, y, obj) { self.clickCount++; if (self.clickCount >= 15) { self.createExplosion(); self.speed = 0; // Stop moving self.clickCount = 0; self.spawnBot11(); // Trigger task 2 } }; self.createExplosion = function () { var explosion = LK.getAsset('explosion', { anchorX: 0.5, anchorY: 0.5, x: self.x, y: self.y, scaleX: 5, scaleY: 5 }); game.addChild(explosion); LK.setTimeout(function () { explosion.destroy(); self.destroy(); // Destroy Bot88 after explosion // Drop attention effect var attentionDrop = LK.getAsset('attentionDrop', { anchorX: 0.5, anchorY: 0.5, x: self.x, y: self.y }); game.addChild(attentionDrop); LK.setTimeout(function () { attentionDrop.destroy(); }, 2000); // Destroy attention drop effect after 2 seconds }, 1000); self.clickCount = 0; // Reset click count self.speed = 5; // Reset speed }; self.spawnBot11 = function () { if (!self.bot11Spawned) { var bot11 = new Bot11(); bot11.x = self.x; bot11.y = self.y; game.addChild(bot11); self.bot11Spawned = true; LK.setTimeout(function () { self.bot11Spawned = false; }, 10000); } }; }); var Button0 = Container.expand(function () { var self = Container.call(this); var buttonGraphics = self.attachAsset('button0', { anchorX: 0.5, anchorY: 0.5 }); self.down = function (x, y, obj) { LK.setScore(LK.getScore() + 55); scoreTxt.setText(LK.getScore()); }; }); var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('miniFriend', { anchorX: 0.5, anchorY: 0.5, color: 0xff0000 // Set color to red }); self.lifetime = 15 * 60; // 15 seconds in ticks self.update = function () { self.lifetime--; if (self.lifetime <= 0) { self.destroy(); } // Move towards the nearest balloon if (balloons.length > 0) { var nearestBalloon = balloons[0]; var minDistance = Math.sqrt(Math.pow(self.x - nearestBalloon.x, 2) + Math.pow(self.y - nearestBalloon.y, 2)); for (var i = 1; i < balloons.length; i++) { var distance = Math.sqrt(Math.pow(self.x - balloons[i].x, 2) + Math.pow(self.y - balloons[i].y, 2)); if (distance < minDistance) { nearestBalloon = balloons[i]; minDistance = distance; } } var angle = Math.atan2(nearestBalloon.y - self.y, nearestBalloon.x - self.x); self.x += Math.cos(angle) * 3; self.y += Math.sin(angle) * 3; } for (var i = balloons.length - 1; i >= 0; i--) { if (self.intersects(balloons[i])) { LK.getSound('rubbish').play(); balloons[i].pop(); LK.getSound('rubbish').play(); LK.getSound('rubbish').play(); LK.getSound('rubbish').play(); LK.setScore(LK.getScore() - 1); scoreTxt.setText(LK.getScore()); self.destroy(); // Destroy enemy after popping a balloon break; // Exit loop after popping one balloon } } }; self.down = function (x, y, obj) { for (var i = balloons.length - 1; i >= 0; i--) { if (self.intersects(balloons[i])) { balloons[i].pop(); LK.setScore(LK.getScore() - 1); scoreTxt.setText(LK.getScore()); self.destroy(); // Destroy enemy after popping a balloon break; // Exit loop after popping one balloon } } }; }); var Enemy2 = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('miniFriend', { anchorX: 0.5, anchorY: 0.5, color: 0xff0000 // Set color to red }); self.lifetime = 10 * 60; // 10 seconds in ticks self.update = function () { self.lifetime--; if (self.lifetime <= 0) { self.destroy(); } // Move towards the nearest balloon if (balloons.length > 0) { var nearestBalloon = balloons[0]; var minDistance = Math.sqrt(Math.pow(self.x - nearestBalloon.x, 2) + Math.pow(self.y - nearestBalloon.y, 2)); for (var i = 1; i < balloons.length; i++) { var distance = Math.sqrt(Math.pow(self.x - balloons[i].x, 2) + Math.pow(self.y - balloons[i].y, 2)); if (distance < minDistance) { nearestBalloon = balloons[i]; minDistance = distance; } } var angle = Math.atan2(nearestBalloon.y - self.y, nearestBalloon.x - self.x); self.x += Math.cos(angle) * 4; // Faster speed self.y += Math.sin(angle) * 4; // Faster speed } for (var i = balloons.length - 1; i >= 0; i--) { if (self.intersects(balloons[i])) { LK.getSound('rubbish').play(); balloons[i].pop(); LK.setScore(LK.getScore() - 1); scoreTxt.setText(LK.getScore()); self.destroy(); // Destroy enemy after popping a balloon break; // Exit loop after popping one balloon } } }; self.down = function (x, y, obj) { for (var i = balloons.length - 1; i >= 0; i--) { if (self.intersects(balloons[i])) { balloons[i].pop(); LK.setScore(LK.getScore() - 1); scoreTxt.setText(LK.getScore()); self.destroy(); // Destroy enemy after popping a balloon break; // Exit loop after popping one balloon } } }; }); var MiniFriend = Container.expand(function () { var self = Container.call(this); var miniFriendGraphics = self.attachAsset('miniFriend', { anchorX: 0.5, anchorY: 0.5 }); self.lifetime = 15 * 60; // 15 seconds in ticks self.update = function () { self.lifetime--; if (self.lifetime <= 0) { self.destroy(); } // Move towards the nearest balloon if (balloons.length > 0) { var nearestBalloon = balloons[0]; var minDistance = Math.sqrt(Math.pow(self.x - nearestBalloon.x, 2) + Math.pow(self.y - nearestBalloon.y, 2)); for (var i = 1; i < balloons.length; i++) { var distance = Math.sqrt(Math.pow(self.x - balloons[i].x, 2) + Math.pow(self.y - balloons[i].y, 2)); if (distance < minDistance) { nearestBalloon = balloons[i]; minDistance = distance; } } var angle = Math.atan2(nearestBalloon.y - self.y, nearestBalloon.x - self.x); self.x += Math.cos(angle) * 2; self.y += Math.sin(angle) * 2; } for (var i = balloons.length - 1; i >= 0; i--) { if (self.intersects(balloons[i])) { balloons[i].pop(); self.destroy(); // Destroy mini friend after popping a balloon break; // Exit loop after popping one balloon } } }; self.down = function (x, y, obj) { for (var i = balloons.length - 1; i >= 0; i--) { if (self.intersects(balloons[i])) { balloons[i].pop(); self.destroy(); // Destroy mini friend after popping a balloon break; // Exit loop after popping one balloon } } }; }); var MusicButton = Container.expand(function () { var self = Container.call(this); var buttonGraphics = self.attachAsset('musicButton', { anchorX: 0.5, anchorY: 0.5 }); self.isPlaying = true; self.down = function (x, y, obj) { if (self.isPlaying) { LK.stopMusic(); } else { LK.playMusic('223'); } self.isPlaying = !self.isPlaying; }; }); var NewEnemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('miniFriend', { anchorX: 0.5, anchorY: 0.5, color: 0xff0000 // Set color to red }); self.lifetime = 20 * 60; // 20 seconds in ticks self.update = function () { self.lifetime--; if (self.lifetime <= 0) { self.destroy(); } // Move towards the nearest balloon if (balloons.length > 0) { var nearestBalloon = balloons[0]; var minDistance = Math.sqrt(Math.pow(self.x - nearestBalloon.x, 2) + Math.pow(self.y - nearestBalloon.y, 2)); for (var i = 1; i < balloons.length; i++) { var distance = Math.sqrt(Math.pow(self.x - balloons[i].x, 2) + Math.pow(self.y - balloons[i].y, 2)); if (distance < minDistance) { nearestBalloon = balloons[i]; minDistance = distance; } } var angle = Math.atan2(nearestBalloon.y - self.y, nearestBalloon.x - self.x); self.x += Math.cos(angle) * 3; self.y += Math.sin(angle) * 3; } for (var i = balloons.length - 1; i >= 0; i--) { if (self.intersects(balloons[i])) { LK.getSound('rubbish').play(); balloons[i].pop(); LK.setScore(LK.getScore() - 1); scoreTxt.setText(LK.getScore()); self.destroy(); // Destroy enemy after popping a balloon break; // Exit loop after popping one balloon } } }; self.down = function (x, y, obj) { for (var i = balloons.length - 1; i >= 0; i--) { if (self.intersects(balloons[i])) { balloons[i].pop(); LK.setScore(LK.getScore() - 1); scoreTxt.setText(LK.getScore()); self.destroy(); // Destroy enemy after popping a balloon break; // Exit loop after popping one balloon } } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x66e4af7512d26d43857c57ab // Init game with landscape background }); /**** * Game Code ****/ var button0 = new Button0(); button0.x = 150; button0.y = 250; LK.gui.topLeft.addChild(button0); // Removed Bot11 asset initialization LK.playMusic('223'); var musicButton = new MusicButton(); musicButton.x = 100; musicButton.y = 100; LK.gui.topLeft.addChild(musicButton); var landscape = LK.getAsset('landscape', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2, scaleX: 2048 / 2048, scaleY: 2732 / 2048, width: 2048, height: 2732 }); game.addChild(landscape); landscape.width = 2048; landscape.height = 2732; var scoreTxt = new Text2('0', { size: 150, fill: "#800080" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var shield = 3; // Initialize shield with 3 lives var balloons = []; var miniFriend = null; var enemySpawned = false; var miniFriendSpawned = false; var enemy2Spawned = false; var explosions = []; // Initialize explosions array to keep track of explosions var background2Created = false; // Initialize background2Created variable var newEnemySpawned = false; // Initialize newEnemySpawned variable // Function to expand explosion effect function expandExplosion(explosion) { var radius = 0; var interval = LK.setInterval(function () { radius += 20; // Increase radius quickly explosion.width = radius; explosion.height = radius; if (radius >= 200) { LK.clearInterval(interval); explosion.destroy(); var index = explosions.indexOf(explosion); if (index > -1) { explosions.splice(index, 1); } } }, 50); // Reduce interval time for faster expansion } var spawnBalloon = function spawnBalloon() { var newBalloon = new Balloon(); newBalloon.x = Math.random() * 2048; newBalloon.y = -100; balloons.push(newBalloon); game.addChild(newBalloon); }; game.update = function () { // Removed Bot11 spawning every 20 seconds for (var i = balloons.length - 1; i >= 0; i--) { if (LK.getScore() >= 20 && LK.getScore() < 30) { balloons[i].speed = 4; } else if (LK.getScore() >= 30 && LK.getScore() < 35) { balloons[i].speed = 6; } else if (LK.getScore() >= 35) { balloons[i].speed = 8; } // Removed unnecessary destruction of balloons when they go off the screen for (var i = balloons.length - 1; i >= 0; i--) { if (balloons[i].y > 2732 - balloons[i].height / 2) { balloons.splice(i, 1); } } for (var i = balloons.length - 1; i >= 0; i--) { if (balloons[i].y > 2732 - balloons[i].height / 2) { balloons.splice(i, 1); } } } if (LK.getScore() >= 70 && !background2Created) { background2Created = true; var background2 = LK.getAsset('background2', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2, scaleX: 2048 / 2048, scaleY: 2732 / 2048, alpha: 0 }); background2.width = 2048; background2.height = 2732; game.addChild(background2); var fadeInInterval = LK.setInterval(function () { background2.alpha += 0.01; if (background2.alpha >= 1) { LK.clearInterval(fadeInInterval); } }, 50); } if (LK.getScore() >= 101) { LK.showVictory(); // Assuming LK.showVictory() is a method to show victory message } else if (LK.getScore() < 0) { LK.showGameOver(); } if (LK.ticks % 60 == 0) { spawnBalloon(); } if (LK.getScore() >= 10 && !miniFriendSpawned) { miniFriendSpawned = true; miniFriend = new MiniFriend(); miniFriend.x = Math.random() * 2048; miniFriend.y = 2732; // Spawn at the bottom of the screen game.addChild(miniFriend); LK.setTimeout(function () { miniFriend.destroy(); miniFriendSpawned = false; }, 20000); // 20 seconds } if (LK.getScore() >= 30 && !enemySpawned) { enemySpawned = true; var enemy = new Enemy(); enemy.x = Math.random() * 2048; enemy.y = 2732; // Spawn at the bottom of the screen game.addChild(enemy); LK.setTimeout(function () { enemy.destroy(); enemySpawned = false; }, 20000); // 20 seconds } if (LK.getScore() >= 40 && !enemy2Spawned) { enemy2Spawned = true; for (var i = 0; i < 4; i++) { var enemy2 = new Enemy2(); enemy2.x = Math.random() * 2048; enemy2.y = 2732; // Spawn at the bottom of the screen game.addChild(enemy2); LK.setTimeout(function () { enemy2.destroy(); }, 20000); // 20 seconds } LK.setTimeout(function () { enemy2Spawned = false; }, 20000); // 20 seconds } if (LK.getScore() >= 50 && !newEnemySpawned) { newEnemySpawned = true; var bot88 = new Bot88(); bot88.x = 2048 / 2; bot88.y = 2732 / 2; // Start at the center of the screen bot88.speed = 5; // Set initial horizontal speed game.addChild(bot88); var bot11Interval = LK.setInterval(function () { bot88.spawnBot11(); }, 10000); // 10 seconds LK.setTimeout(function () { bot88.destroy(); LK.clearInterval(bot11Interval); newEnemySpawned = false; }, 20000); // 20 seconds } }; LK.showVictory = function () { // Display victory message var victoryTxt = new Text2('Victory!', { size: 200, fill: "#00FF00" }); victoryTxt.anchor.set(0.5, 0.5); victoryTxt.x = 2048 / 2; victoryTxt.y = 2732 / 2; LK.gui.center.addChild(victoryTxt); // Pause the game LK.showGameOver(); };
===================================================================
--- original.js
+++ change.js
@@ -520,10 +520,14 @@
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
y: 2732 / 2,
+ scaleX: 2048 / 2048,
+ scaleY: 2732 / 2048,
alpha: 0
});
+ background2.width = 2048;
+ background2.height = 2732;
game.addChild(background2);
var fadeInInterval = LK.setInterval(function () {
background2.alpha += 0.01;
if (background2.alpha >= 1) {
Шарик воздушный на с галстуком Ярко жолтый цвет и синий галстук. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Пчела. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Круглая кнопка прозрачная внутри нота. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Поле, посередине Луна ночная версия. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.