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 в нижнюю часть экрана
User prompt
подвинуть кнопку TOP на 50 пикселей вверх
User prompt
Please fix the bug: 'ReferenceError: uskorenie is not defined' in or related to this line: 'if (child !== player && child !== buttonTop && child !== buttonBot && child !== uskorenie) {' Line Number: 245
User prompt
удалить картинку Uskorenie
Code edit (2 edits merged)
Please save this source code
User prompt
добавить прыжок
User prompt
удалить все анимации с плагином TWEEN и сам плагин удалить ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Поменяй фон на серый
User prompt
Please fix the bug: 'Timeout.tick error: tween is not defined' in or related to this line: 'tween(ball, {' Line Number: 168 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: tween is not defined' in or related to this line: 'tween(ball, {' Line Number: 168 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: tween is not defined' in or related to this line: 'tween(ball, {' Line Number: 168 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Исправить ошибку, когда картинка Uskorenie не летит в верхний левый угол
User prompt
Картинка ускорение летит со скорость 10
User prompt
Картинка Uskorenie летит в левый верхний угол
User prompt
Please fix the bug: 'Timeout.tick error: The supplied index is out of bounds' in or related to this line: 'game.setChildIndex(uskorenie, game.children.length - 10); // Ensure Uskorenie is on top' Line Number: 172
===================================================================
--- original.js
+++ change.js
@@ -1,5 +1,10 @@
/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
* Classes
****/
// test
var ButtonBot = Container.expand(function () {
@@ -12,17 +17,31 @@
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) {
- player.y = 2732 / 2 - 250;
- player.inAir = false;
- player.doubleJump = false;
+ 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
- player.y = 2732 / 2 - 250;
- player.inAir = false;
- player.doubleJump = false;
+ 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) {
@@ -44,14 +63,45 @@
self.down = function (x, y, obj) {
if (!player.doubleJump) {
if (player.inAir) {
player.doubleJump = true;
- player.y -= 400; // Double jump height
- player.rotation -= Math.PI * 2;
+ 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;
- player.y -= 400; // Initial jump height
+ 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
@@ -107,10 +157,18 @@
}));
ball.x = ball.width / 2 - 100; // Shift ball 100 pixels to the left
ball.y = 2732 / 2 - 300; // Center ball vertically
LK.setTimeout(function () {
- ball.x += 400;
- ball.destroy(); // Remove the ball after it moves 200 pixels
+ 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
создать мультяшного сидячего персонажа. 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