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
@@ -138,32 +138,56 @@
LK.setTimeout(function () {
vzriv.destroy();
}, 2100);
}, 1860);
-// Declare uskorenie in the global scope
-var uskorenie;
-// Function to create and add a new Uskorenie image
-function createUskorenie() {
- var randomSize = Math.floor(Math.random() * 21) + 10; // Random size between 10 and 30
- uskorenie = LK.getAsset('Uskorenie', {
- anchorX: 0.5,
- // Center horizontally
- anchorY: 0.5,
- // Center vertically
- scaleX: randomSize / 50,
- // Scale based on random size
- scaleY: randomSize / 50 // Scale based on random size
+// Add USKORENIE image to the left center of the screen
+var uskorenie = LK.getAsset('Uskorenie', {
+ anchorX: 0.5,
+ // Center horizontally
+ anchorY: 0.5 // Center vertically
+});
+uskorenie.x = uskorenie.width / 2 + 120; // Position at the left center of the screen
+uskorenie.y = 2732 / 2 - 280; // Center vertically
+game.addChild(uskorenie);
+game.setChildIndex(uskorenie, game.children.length - 1); // Ensure Uskorenie is on top
+// Update function to move Uskorenie towards the top-left corner
+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
});
- uskorenie.x = uskorenie.width / 2 + 220; // Position at the left center of the screen
- uskorenie.y = 2732 / 2 - 200; // Center vertically
- game.addChild(uskorenie);
- // Ensure the index is within valid range
- game.setChildIndex(uskorenie, Math.max(0, game.children.length - 10)); // Ensure Uskorenie is on top
-}
-// Create a new Uskorenie image every second, starting after 2 seconds
-LK.setTimeout(function () {
- LK.setInterval(createUskorenie, 5);
-}, 2000);
+ // 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();
+ }
+ }
+ // Move Uskorenie towards the top-left corner
+ uskorenie.x -= 5;
+ uskorenie.y -= 5;
+};
// Add player to the game
var ball = game.addChild(LK.getAsset('Ball', {
anchorX: 0.5,
anchorY: 0.5
@@ -251,24 +275,16 @@
}
buttonTop.interactive = true;
buttonBot.interactive = true;
game.children.forEach(function (child) {
- if (child !== player && child !== buttonTop && child !== buttonBot) {
+ 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
}
}
- if (child === uskorenie) {
- // Move Uskorenie with its own speed and direction
- child.x -= 10; // Move left with a fixed speed
- child.y -= 10; // Move upwards with a fixed speed
- if (child.x + child.width / 2 < 0 || child.x - child.width / 2 > 2048 || child.y + child.height / 2 < 0 || child.y - child.height / 2 > 2732) {
- child.destroy(); // Remove Uskorenie if it goes off screen
- }
- }
game.setChildIndex(player, game.children.length - 1); // Move player to the top
});
// Add shaking effect to the player
if (gameStarted) {
создать мультяшного сидячего персонажа. 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