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
@@ -217,22 +217,31 @@
var instruction = game.attachAsset('Instruction', {
anchorX: 0.5,
anchorY: 0.5
});
-instruction.x = 2048 / 2 - 100;
+instruction.x = 2048 / 2;
instruction.y = 2732 / 2;
// 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) {
+ var targetXLeft = instruction.x - 100; // Target position after moving left by 100 pixels
+ var targetXRight = instruction.x + 200; // Target position after moving right by 200 pixels from original position
+ var moveLeft = function moveLeft() {
+ if (instruction.x > targetXLeft) {
+ instruction.x -= 8; // Move instruction left by 8 pixels per tick
+ LK.setTimeout(moveLeft, 1000 / 60); // Continue moving at 60FPS
+ } else {
+ moveRight();
+ }
+ };
+ var moveRight = function moveRight() {
+ if (instruction.x < targetXRight) {
instruction.x += 8; // Move instruction right by 8 pixels per tick
- LK.setTimeout(moveStep, 1000 / 60); // Continue moving at 60FPS
+ LK.setTimeout(moveRight, 1000 / 60); // Continue moving at 60FPS
} else {
instruction.visible = false; // Make instruction disappear after reaching target
}
};
- moveStep();
+ moveLeft();
};
LK.setTimeout(moveInstruction, 1000); // Start moving after a delay of 1 second
// Update score based on game ticks
LK.on('tick', function () {
снаряд от пушки. 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.