Code edit (10 edits merged)
Please save this source code
User prompt
Убрать Делей в 1 секунду у instruction
User prompt
Перемещать instruction сначала влево на пикселей, потом вправо
User prompt
Перемещать instruction плавно со скоростью 8
User prompt
После начала игры сдвинуть переместить instruction влево на 100 пикселей, потом вправо на 200 пикселей. Потом instruction исчезает
User prompt
Добавить в центр экрана instruction
Code edit (1 edits merged)
Please save this source code
User prompt
сдвинуть background2 Влево на 100 пикселей
Code edit (1 edits merged)
Please save this source code
User prompt
удалить white flag
Code edit (3 edits merged)
Please save this source code
User prompt
переместить игрока на верхний слой по сравнению с whiteflag
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -219,16 +219,22 @@
anchorY: 0.5
});
instruction.x = 2048 / 2 - 100;
instruction.y = 2732 / 2;
-// Move instruction right by 200 pixels after a delay
-LK.setTimeout(function () {
- instruction.x += 200;
-}, 1000); // Delay of 1 second
-// Make instruction disappear after moving right
-LK.setTimeout(function () {
- instruction.visible = false;
-}, 2000); // Delay of 2 seconds to ensure it happens after the move
+// Smoothly move instruction with a speed of 8
+var moveInstruction = function moveInstruction() {
+ var targetX = instruction.x + 200; // Target position after moving right by 200 pixels
+ var moveStep = function moveStep() {
+ if (instruction.x < targetX) {
+ instruction.x += 8; // Move instruction right by 8 pixels per tick
+ LK.setTimeout(moveStep, 1000 / 60); // Continue moving at 60FPS
+ } else {
+ instruction.visible = false; // Make instruction disappear after reaching target
+ }
+ };
+ moveStep();
+};
+LK.setTimeout(moveInstruction, 1000); // Start moving after a delay of 1 second
// Update score based on game ticks
LK.on('tick', function () {
scoreCounter = Math.floor(LK.ticks / 60); // Convert ticks to seconds for score
scoreTxt.setText(scoreCounter.toString()); // Update score display
снаряд от пушки. 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.