User prompt
добавить картинку vzriv влево в центр
User prompt
Мяч начинает лететь с задержкой 1.5 секунды ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Сдвинуть начальное положение мяча влево на 100
User prompt
Увеличить скорость полета мяча еще в два раза
User prompt
Увеличить скорость полета мяча еще в два раза
User prompt
Увеличить скорость полета мяча в два раза
User prompt
Ball плавно Летит горизонтально 200 пикселей и исчезает ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Добавить картинку ball в левой части экрана
User prompt
Создать класс ball
User prompt
Первые 2 секунды игры, кнопки button_top и button_bot не активные
User prompt
Оптимизировать игру
User prompt
Первые 2 секунды игры, кнопки совсем не активны
User prompt
Первые 2 секунды игры нельзя отжать button_bot
User prompt
Первые 2 секунд игры, нельзя нажать button_bot
User prompt
Исправить ошибку, когда button_bot нажимается раньше, чем 2 секунды начала игры
User prompt
Первые 2 секунды игры, нельзя нажать на кнопки button_top и button_bot
User prompt
при нажатии на Button_bot, поворот на 80 градусов происходит только на земле, не в полете
User prompt
при нажатии на button_bot длительность не изменяется
User prompt
если нажали button_Bot, то это кнопка автоматически зажата 1 секунды
User prompt
если нажали button_Bot, то это кнопка автоматически зажата 0,2 секунды
Code edit (1 edits merged)
Please save this source code
User prompt
исправить ошибку, когда нажата button_bot и если перед приземлением отжать кнопку, то персонаж крутится в обратном направлении
User prompt
покажи в коде, где находится местоположение игрока
===================================================================
--- original.js
+++ change.js
@@ -13,9 +13,9 @@
anchorY: 0.5
});
// Add down event to set landing duration to 100 during jump or double jump
self.down = function (x, y, obj) {
- if (gameStarted && !player.inAir && !player.doubleJump) {
+ 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
@@ -46,9 +46,9 @@
}
};
// Add up event to reset rotation
self.up = function (x, y, obj) {
- if (gameStarted && !player.inAir && !player.doubleJump) {
+ if (!player.inAir && !player.doubleJump) {
player.rotation += Math.PI / 2.25; // Rotate back 80 degrees clockwise
}
};
});
@@ -60,9 +60,9 @@
anchorY: 0.5
});
// Add down event to trigger jump
self.down = function (x, y, obj) {
- if (gameStarted && !player.doubleJump) {
+ if (!player.doubleJump) {
if (player.inAir) {
player.doubleJump = true;
tween(player, {
y: player.y - 400,
@@ -142,17 +142,42 @@
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
-}, 1000);
+ 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);
@@ -165,10 +190,14 @@
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.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
@@ -179,9 +208,9 @@
}
game.setChildIndex(player, game.children.length - 1); // Move player to the top
});
// Add shaking effect to the player
- if (gameStarted && LK.ticks % 2 === 0) {
+ if (gameStarted) {
player.x += Math.sin(LK.ticks / 0.5) * 3;
player.y += Math.cos(LK.ticks / 0.5) * 3;
}
};
\ No newline at end of file
создать мультяшного сидячего персонажа. 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