User prompt
Растянуть фон
User prompt
Фон зделать пейзаж
User prompt
Лоншафт
User prompt
Изменить фон
User prompt
Враки синий
User prompt
Враг красный
User prompt
Враг 2
User prompt
Please fix the bug: 'ReferenceError: enemySpawned is not defined' in or related to this line: 'if (LK.getScore() >= 30 && !enemySpawned) {' Line Number: 293
User prompt
Когда достигает 30. Враг делает тоже самое что друг но убегает 1 бал
User prompt
Друг взрывает 1 раз
User prompt
Если друг взрывает шарик то 0 балов
User prompt
Друг дает 0 балов
User prompt
Друг лопает 1 шарик дает 1 бал
User prompt
Друг медлено
User prompt
Друг двигается к шарикам
User prompt
"Друг ловит шарики
User prompt
Когда достигает до 10 балов мне дают мини "друг"на 15 секунд после умерает. поевляеца через 20 секунд он при прикосновения шара взрывает их дает мне 1 бал
User prompt
Когда будет -1 бал я проиграл
User prompt
Когда шары преземляюца они отменяют 1 бал и ищезают
User prompt
Шары не уходят за фон
User prompt
Фон
User prompt
Взрыв быстро раширяеца
User prompt
Взрыв ищезает
User prompt
Взрыв раширяеца и толкает всех вокруг него
User prompt
При взрыве шары подбрасывает верх если они близко
/**** * 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()); 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; } } } self.destroy(); if (LK.getScore() >= 50 || LK.getScore() < 0) { LK.showGameOver(); } }; }); var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('miniFriend', { anchorX: 0.5, anchorY: 0.5, color: 0x0000ff // Set color to blue }); 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(); 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: 0x0000ff // Set color to blue }); 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) * 3; // Faster speed self.y += Math.sin(angle) * 3; // Faster speed } 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 } } }; 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 } } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB // Init game with sky blue background }); /**** * Game Code ****/ var scoreTxt = new Text2('0', { size: 150, fill: "#ffffff" }); 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 // 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 () { for (var i = balloons.length - 1; i >= 0; i--) { if (LK.getScore() >= 20) { balloons[i].speed = 4; } // 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() < 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 = Math.random() * 2732; 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 = Math.random() * 2732; game.addChild(enemy); LK.setTimeout(function () { enemy.destroy(); enemySpawned = false; }, 20000); // 20 seconds } if (LK.getScore() >= 40 && !enemy2Spawned) { enemy2Spawned = true; var enemy2 = new Enemy2(); enemy2.x = Math.random() * 2048; enemy2.y = Math.random() * 2732; game.addChild(enemy2); LK.setTimeout(function () { enemy2.destroy(); enemy2Spawned = false; }, 20000); // 20 seconds } };
===================================================================
--- original.js
+++ change.js
@@ -113,9 +113,9 @@
var self = Container.call(this);
var enemyGraphics = self.attachAsset('miniFriend', {
anchorX: 0.5,
anchorY: 0.5,
- color: 0xff0000 // Set color to red
+ color: 0x0000ff // Set color to blue
});
self.lifetime = 15 * 60; // 15 seconds in ticks
self.update = function () {
self.lifetime--;
@@ -163,9 +163,9 @@
var self = Container.call(this);
var enemyGraphics = self.attachAsset('miniFriend', {
anchorX: 0.5,
anchorY: 0.5,
- color: 0xff0000 // Set color to red
+ color: 0x0000ff // Set color to blue
});
self.lifetime = 10 * 60; // 10 seconds in ticks
self.update = function () {
self.lifetime--;
Шарик воздушный на с галстуком Ярко жолтый цвет и синий галстук. 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.