User prompt
Поднять на 20 пикселей вверх
User prompt
Опустить 123 на 300 пикселей вниз
User prompt
123.rotation = Math.PI / 9;
User prompt
Добавить изображение 123 в середину экрана
User prompt
Исправить ошибку, когда во время запуска игры делаешь первый прыжок и происходит лаг в игре
Code edit (3 edits merged)
Please save this source code
User prompt
Последующие изображения fon_snizu сдвинуть на 1000 пикселей вправо
Code edit (2 edits merged)
Please save this source code
User prompt
Исправить ошибку, когда последующее создание Fon_snizu ниже, чем первая картинка fon_snizu
User prompt
Каждую секунду
User prompt
Создавать в правой части экрана новое изображение fon_snizu каждые 3 секунды
Code edit (1 edits merged)
Please save this source code
User prompt
Изменить расположение изображение fon_snizu на 600 пикселей вниз
User prompt
Сделай вот так
User prompt
Сделай вот так: game.setChildIndex(fonSnizu, 0);
User prompt
Алгоритм сделать аналогичный fon_snizu как у background _ 1
User prompt
Добавить fon_snizu в нижнюю часть экрана
User prompt
Изменить цвет фона на белый
User prompt
Изменит цвет фона на 361E10
User prompt
Измерит цвет фона на DAEAFF
User prompt
Разделить background color на две части верхнюю и нижнюю
Code edit (1 edits merged)
Please save this source code
User prompt
Опустить вниз на 800
User prompt
Добавить отдельный элемент fon_snizu
User prompt
Добавить задний фон fon_snizu в нижнюю часть экрана
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ // test var ButtonBot = Container.expand(function () { var self = Container.call(this); var buttonBotGraphics = self.attachAsset('BUTTON_BOT', { anchorX: 0.5, anchorY: 0.5 }); // Add down event to set landing duration to 100 during jump or double jump self.down = function (x, y, obj) { if (!player.inAir && !player.doubleJump) { player.rotation -= Math.PI / 2.25; // Rotate 80 degrees counter-clockwise } else if (player.inAir || player.doubleJump) { tween(player, { y: 2732 / 2 - 250 }, { duration: 100, onFinish: function onFinish() { player.inAir = false; player.doubleJump = false; player.y = 2732 / 2 - 250; } }); } if (player.inAir || player.doubleJump) { player.rotation -= Math.PI / 2.25; // Rotate 80 degrees counter-clockwise tween(player, { y: 2732 / 2 - 250 }, { duration: 100, onFinish: function onFinish() { player.inAir = false; player.doubleJump = false; player.y = 2732 / 2 - 250; } }); } }; // Add up event to reset rotation self.up = function (x, y, obj) { if (!player.inAir && !player.doubleJump) { player.rotation += Math.PI / 2.25; // Rotate back 80 degrees clockwise } else if (player.inAir || player.doubleJump) { player.rotation += Math.PI / 2.25; // Rotate back 80 degrees clockwise } }; }); // Create a button top class var ButtonTop = Container.expand(function () { var self = Container.call(this); var buttonTopGraphics = self.attachAsset('BUTTON_TOP', { anchorX: 0.5, anchorY: 0.5 }); // Add down event to trigger jump self.down = function (x, y, obj) { if (!player.doubleJump) { if (player.inAir) { player.doubleJump = true; tween(player, { y: player.y - 400, rotation: player.rotation - Math.PI * 2 }, { duration: 230, easing: tween.easeInOut, onFinish: function onFinish() { tween(player, { y: 2732 / 2 - 250 }, { duration: 500, onFinish: function onFinish() { player.inAir = false; player.doubleJump = false; player.y = 2732 / 2 - 250; } }); } }); return; } player.inAir = true; tween(player, { y: player.y - 400 }, { duration: 100, onFinish: function onFinish() { tween(player, { y: 2732 / 2 - 250 }, { duration: 700, onFinish: function onFinish() { player.inAir = false; } }); } }); } }; }); // Create a player class var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('character', { anchorX: 0.5, anchorY: 0.5 }); // Initialize the inAir flag self.inAir = false; self.doubleJump = false; }); /**** * Initialize Game ****/ // Add player to the game var game = new LK.Game({ backgroundColor: 0x808080 }); /**** * Game Code ****/ LK.setTimeout(function () { vzriv = game.addChild(LK.getAsset('Vzriv', { anchorX: 0.5, anchorY: 0.5 })); vzriv.x = vzriv.width / 2 + 90; // Position Vzriv at the left center of the screen vzriv.y = 2732 / 2 - 280; // Center Vzriv vertically game.setChildIndex(player, game.children.length - 1); // Ensure player is on top // Remove Vzriv 2.1 seconds after the game starts LK.setTimeout(function () { vzriv.destroy(); }, 2100); }, 1860); // Add fon_snizu to the game var fonSnizu = game.addChild(LK.getAsset('Fon_snizu', { anchorX: 0.5, // Center anchor horizontally anchorY: 0.5 // Center anchor vertically })); fonSnizu.x = 2048 / 2; // Center fon_snizu horizontally fonSnizu.y = 2732 - fonSnizu.height / 2 + 800; // Position fon_snizu 800 pixels further down // Add player to the game var ball = game.addChild(LK.getAsset('Ball', { anchorX: 0.5, anchorY: 0.5 })); var uskorenie = game.addChild(LK.getAsset('Uskorenie', { anchorX: 0.5, anchorY: 0.5 })); ball.x = ball.width / 2 - 100; // Shift ball 100 pixels to the left ball.y = 2732 / 2 - 300; // Center ball vertically LK.setTimeout(function () { tween(ball, { x: ball.x + 400 }, { duration: 360, // Reduced duration to double the speed easing: tween.linear, onFinish: function onFinish() { ball.destroy(); // Remove the ball after it moves 200 pixels } }); }, 1500); game.down = function (x, y, obj) {}; var player = game.addChild(new Player()); player.x = player.width / 2 + 200; // Position player 200 units to the right of the center left of the screen player.y = 2732 / 2 - 250; // Move player 150 units down player.rotation = Math.PI / 12; // Set initial rotation to 15 degrees clockwise // Add background to the game var background = game.addChild(LK.getAsset('background_1', { anchorX: 0.5, anchorY: 0.5 })); game.setChildIndex(background, 0); // Move background to the bottom background.x = 2048 / 2; // Center background horizontally background.y = 2732 / 2 + 150; // Move background down by 550 pixels background.rotation = Math.PI / 9; // Rotate background by 20 degrees clockwise // Move background_1 towards its left side var backgroundCounter = 0; var backgroundTimer = LK.setInterval(function () { var newBackground = game.addChild(LK.getAsset('background_1', { anchorX: 0.5, anchorY: 0.5 })); newBackground.x = 2048 / 2 + 2500; // Move background 2048 pixels to the right newBackground.y = 2732 / 2 + 1060; // Move background down by 1100 pixels newBackground.rotation = Math.PI / 9; // Rotate background by 20 degrees clockwise backgroundCounter++; if (backgroundCounter === 1) { LK.clearInterval(backgroundTimer); backgroundTimer = LK.setInterval(function () { var newBackground = game.addChild(LK.getAsset('background_1', { anchorX: 0.5, anchorY: 0.5 })); newBackground.x = 2048 / 2 + 2500; // Move background 2048 pixels to the right newBackground.y = 2732 / 2 + 1060; // Move background down by 1100 pixels newBackground.rotation = Math.PI / 9; // Rotate background by 20 degrees clockwise }, 3200); } else if (backgroundCounter === 2) { LK.clearInterval(backgroundTimer); backgroundTimer = LK.setInterval(function () { var newBackground = game.addChild(LK.getAsset('background_1', { anchorX: 0.5, anchorY: 0.5 })); newBackground.x = 2048 / 2 + 2500; // Move background 2048 pixels to the right newBackground.y = 2732 / 2 + 1060; // Move background down by 1100 pixels newBackground.rotation = Math.PI / 9; // Rotate background by 20 degrees clockwise }, 1000); } }, 500); var gameStarted = false; var gameStartTimer = LK.setTimeout(function () { gameStarted = true; }, 2000); // Add BUTTON_TOP to the game var buttonTop = game.addChild(new ButtonTop()); buttonTop.x = 2048 - buttonTop.width / 2 - 20; // Position buttonTop 20 units to the left of the right edge of the screen buttonTop.y = 2732 - buttonTop.height / 2 - 370; // Position buttonTop 370 units above the bottom edge of the screen // Add BUTTON_BOT to the game var buttonBot = game.addChild(new ButtonBot()); buttonBot.x = 2048 - buttonBot.width / 2 - 20; // Position buttonBot 20 units to the left of the right edge of the screen buttonBot.y = 2732 - buttonBot.height / 2 - 20; // Position buttonBot 20 units above the bottom edge of the screen game.update = function () { if (!gameStarted) { buttonTop.interactive = false; buttonBot.interactive = false; return; } buttonTop.interactive = true; buttonBot.interactive = true; game.children.forEach(function (child) { if (child !== player && child !== buttonTop && child !== buttonBot && child !== uskorenie) { child.x -= 15 * Math.cos(child.rotation); // Increase the speed by 1.5 times child.y -= 15 * Math.sin(child.rotation); // Increase the speed by 1.5 times if (child.x + child.width / 2 < 0) { // If the right edge of the background is less than 0 (completely off the screen) child.destroy(); // Remove the background } } game.setChildIndex(player, game.children.length - 1); // Move player to the top }); // Add shaking effect to the player if (gameStarted) { if (LK.ticks < 130) { // Strong shake for the first second (assuming 60 FPS) player.x += Math.sin(LK.ticks / 0.5) * 10; player.y += Math.cos(LK.ticks / 0.5) * 10; } else { player.x += Math.sin(LK.ticks / 0.5) * 3; player.y += Math.cos(LK.ticks / 0.5) * 3; } if (vzriv && vzriv.parent) { vzriv.destroy(); } } };
===================================================================
--- original.js
+++ change.js
@@ -146,9 +146,9 @@
// Center anchor horizontally
anchorY: 0.5 // Center anchor vertically
}));
fonSnizu.x = 2048 / 2; // Center fon_snizu horizontally
-fonSnizu.y = 2732 - fonSnizu.height / 2; // Position fon_snizu at the bottom of the screen
+fonSnizu.y = 2732 - fonSnizu.height / 2 + 800; // Position fon_snizu 800 pixels further down
// Add player to the game
var ball = game.addChild(LK.getAsset('Ball', {
anchorX: 0.5,
anchorY: 0.5
создать мультяшного сидячего персонажа. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
snowball. 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
Ufo (летающая тарелка). Мультяшная. 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
Куст в снегу мультяшный. 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
снежинка. мультяшная. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
text: New Record! Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows