User prompt
при сборе коинов и суперкоинов должен звучать звук из папки coin
User prompt
после нажатия кнопки уровня, должна включаться музыка
User prompt
музыки не слышно
User prompt
игрок должен слышать музуку в фоновом режиме
User prompt
замкни цикл этих песен
User prompt
Please fix the bug: 'Uncaught TypeError: game.resume is not a function' in or related to this line: 'game.resume();' Line Number: 88
User prompt
сделай фрэйм больше, чтобы было хорошо видно надпись
User prompt
сделай фрэйм ровный, он сплющенный
User prompt
расширь фрэйм немного вверх и вниз
User prompt
сделай этот фрэйм во всю ширину кнопок
User prompt
добавь над кнопками с выбором уровня прямоугольный пустой фрэйм
User prompt
Please fix the bug: 'Uncaught TypeError: game.resume is not a function' in or related to this line: 'game.resume();' Line Number: 64
User prompt
сделай кнопки выбора уровня в 1,5 раза крупнее
User prompt
хочу поставить изображение на фон игры
User prompt
в настройках изображения добавь фон игры серый
User prompt
за суперкоин должны начислять случайное количество монет 5-10
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'for (var i = superCoins.length - 1; i >= 0; i--) {' Line Number: 166
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'for (var i = superCoins.length - 1; i >= 0; i--) {' Line Number: 165
User prompt
добавь суперкоины, они должны попадаться редко во всех уровнях
User prompt
если есть клонированные кнопки выбора уровня, то удали 1 клон
User prompt
кнопки выбора уровня исчезают со 2-го клика, необходимо это исправить, они должны исезать после 1-го клика
User prompt
Please fix the bug: 'Uncaught TypeError: LK.resume is not a function' in or related to this line: 'LK.resume();' Line Number: 60
User prompt
после 1 клика на кнопку с выбором уровни они должны убраться
User prompt
почему элемнты вначале игры двигаются? Они должны начать двигаться после нажатия на кнопку с выбором уровня
User prompt
кнопки выбора уровня сложности должны нажииматься с первого клика
/**** * Classes ****/ //<Assets used in the game will automatically appear here> // Coin class var Coin = Container.expand(function () { var self = Container.call(this); var coinGraphics = self.attachAsset('coin', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { if (game.difficulty) { self.y += 5; // Move coin downwards if (self.y > 2732) { self.destroy(); } } }; }); // Obstacle class var Obstacle = Container.expand(function () { var self = Container.call(this); var obstacleGraphics = self.attachAsset('obstacle', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { if (game.difficulty) { self.y += 7; // Move obstacle downwards if (self.y > 2732) { self.destroy(); } } }; }); // Pause Menu class var PauseMenu = Container.expand(function () { var self = Container.call(this); var easyButton = self.attachAsset('easyButton', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 - 200, y: 2732 / 2 }); easyButton.down = function (x, y, obj) { game.difficulty = 'easy'; LK.effects.flashObject(easyButton, 0xffffff, 500); self.destroy(); }; self.addChild(easyButton); var mediumButton = self.attachAsset('mediumButton', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); mediumButton.down = function (x, y, obj) { game.difficulty = 'medium'; LK.effects.flashObject(mediumButton, 0xffffff, 500); self.destroy(); }; self.addChild(mediumButton); var hardButton = self.attachAsset('hardButton', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 200, y: 2732 / 2 }); hardButton.down = function (x, y, obj) { game.difficulty = 'hard'; LK.effects.flashObject(hardButton, 0xffffff, 500); self.destroy(); }; self.addChild(hardButton); }); // Player class var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.move = function (x, y, obj) { var game_position = game.toLocal(obj.global); self.x = game_position.x; self.y = game_position.y; }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ game.addChild(new PauseMenu()); game.addChild(new PauseMenu()); // Initialize arrays and variables var coins = []; var obstacles = []; var score = 0; var scoreTxt = new Text2('0', { size: 150, fill: "#ffffff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Create player var player = game.addChild(new Player()); player.x = 2048 / 2; player.y = 2732 - 200; // Handle move events game.move = function (x, y, obj) { player.move(x, y, obj); }; // Update game logic game.update = function () { // Update coins for (var i = coins.length - 1; i >= 0; i--) { if (coins[i].intersects(player)) { score += 1; scoreTxt.setText(score); coins[i].destroy(); coins.splice(i, 1); } else if (coins[i].y > 2732) { coins[i].destroy(); coins.splice(i, 1); } } // Update obstacles for (var i = obstacles.length - 1; i >= 0; i--) { if (obstacles[i].intersects(player)) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } else if (obstacles[i].y > 2732) { obstacles[i].destroy(); obstacles.splice(i, 1); } } // Spawn coins if (LK.ticks % 60 == 0) { var newCoin = new Coin(); newCoin.x = Math.random() * 2048; newCoin.y = -50; coins.push(newCoin); game.addChild(newCoin); } // Spawn obstacles if (LK.ticks % (game.difficulty == 'easy' ? 90 : game.difficulty == 'medium' ? 60 : 30) == 0) { var newObstacle = new Obstacle(); newObstacle.x = Math.random() * 2048; newObstacle.y = -50; obstacles.push(newObstacle); game.addChild(newObstacle); } };
===================================================================
--- original.js
+++ change.js
@@ -46,9 +46,8 @@
easyButton.down = function (x, y, obj) {
game.difficulty = 'easy';
LK.effects.flashObject(easyButton, 0xffffff, 500);
self.destroy();
- game.resume();
};
self.addChild(easyButton);
var mediumButton = self.attachAsset('mediumButton', {
anchorX: 0.5,
@@ -59,9 +58,8 @@
mediumButton.down = function (x, y, obj) {
game.difficulty = 'medium';
LK.effects.flashObject(mediumButton, 0xffffff, 500);
self.destroy();
- game.resume();
};
self.addChild(mediumButton);
var hardButton = self.attachAsset('hardButton', {
anchorX: 0.5,
@@ -72,9 +70,8 @@
hardButton.down = function (x, y, obj) {
game.difficulty = 'hard';
LK.effects.flashObject(hardButton, 0xffffff, 500);
self.destroy();
- game.resume();
};
self.addChild(hardButton);
});
// Player class