Code edit (1 edits merged)
Please save this source code
User prompt
Сдвинуть palka вправо на 200 пикселей
Code edit (11 edits merged)
Please save this source code
User prompt
Добавить palka в центр картинки top
User prompt
Добавить razduplis в левый верхний угол
User prompt
Оптимизировать игру
User prompt
Установить скорость 35
User prompt
Поменять местами score и scoreicon
Code edit (1 edits merged)
Please save this source code
User prompt
Переместить вправо и вниз на 20 пикселей scoreicon
User prompt
Добавить картинку “scoreicon” в верхнюю часть экрана. Score не трогать
User prompt
Добавить scoreicon в верхнюю среднюю часть экрана
User prompt
Добавить scoreicon в правую верхнюю часть экрана
Code edit (2 edits merged)
Please save this source code
User prompt
Переместить taimer на 20 пикселей вправо
User prompt
Переместить taimer на 20 пикселей ниже
User prompt
Добавить taimer в левый верхний угол
User prompt
Опустить на 20 пикселей таймер и сдвинуть вправо на 100 пикселей
User prompt
Опустить на 20 пикселей score
User prompt
Переместить score в правый центр картинки top
Code edit (1 edits merged)
Please save this source code
User prompt
Круг не может появится на картинке top
Code edit (2 edits merged)
Please save this source code
User prompt
Сделать цвет таймера и счетчика черным
User prompt
Добавить картинку top в верхнюю часть экрана
/**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var top = game.addChild(LK.getAsset('Top', { anchorX: 0.5, anchorY: 0, x: 2048 / 2, y: 0 })); var taimer = game.addChild(LK.getAsset('Taimer', { anchorX: 0, anchorY: 0, x: 0, y: 20 })); var ball = game.addChild(LK.getAsset('ball', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 - 150 })); ball.update = function () { var dx = circle.x - ball.x; var dy = circle.y - ball.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 30) { ball.x += dx / distance * 30; ball.y += dy / distance * 30; } else { oldCircle = circle; circle = generateCircle(); if (oldCircle) { LK.setTimeout(function () { if (oldCircle) { oldCircle.destroy(); oldCircle = null; } }, 100); } } }; function generateCircle() { var x = Math.random() * (2048 - 300) + 150; var y = Math.random() * (2732 - 300 - 200) + 150 + 200; scored = false; var newCircle = game.addChild(LK.getAsset('Circle', { anchorX: 0.5, anchorY: 0.5, x: x, y: y })); if (oldCircle && newCircle.intersects(oldCircle)) { newCircle.destroy(); return generateCircle(); } return newCircle; } var score = 0; var scored = false; var oldCircle = null; var circle = generateCircle(); var countdown = 2; var countdownTxt = new Text2('2', { size: 80, fill: "#000000" }); countdownTxt.anchor.set(0, 0); countdownTxt.y += 20; countdownTxt.x += 100; LK.gui.topLeft.addChild(countdownTxt); var countdownTimer = LK.setInterval(function () { countdown--; countdownTxt.setText(countdown); if (countdown <= 0) { LK.clearInterval(countdownTimer); LK.showGameOver(score); } }, 1000); var scoreTxt = new Text2('0', { size: 80, fill: "#000000" }); scoreTxt.anchor.set(1, 0); scoreTxt.y += 20; LK.gui.topRight.addChild(scoreTxt); game.down = function (x, y, obj) { var dx = circle.x - ball.x; var dy = circle.y - ball.y; var distance = Math.sqrt(dx * dx + dy * dy); var dxOld = oldCircle ? oldCircle.x - ball.x : 0; var dyOld = oldCircle ? oldCircle.y - ball.y : 0; var distanceOld = Math.sqrt(dxOld * dxOld + dyOld * dyOld); if (distance > 0 && distance <= 150 || distanceOld > 0 && distanceOld <= 150 && !scored) { score++; scored = true; scoreTxt.setText(score); countdown = 2; countdownTxt.setText(countdown); countdownTxt.style = { fill: "#000000" }; // Black LK.clearInterval(countdownTimer); countdownTimer = LK.setInterval(function () { countdown--; countdownTxt.setText(countdown); if (countdown <= 0) { LK.clearInterval(countdownTimer); if (!scored) { LK.setScore(score); LK.showGameOver(); } scored = false; } }, 1000); scored = false; } else { LK.setScore(score); LK.showGameOver(); } };
===================================================================
--- original.js
+++ change.js
@@ -17,9 +17,9 @@
var taimer = game.addChild(LK.getAsset('Taimer', {
anchorX: 0,
anchorY: 0,
x: 0,
- y: 0
+ y: 20
}));
var ball = game.addChild(LK.getAsset('ball', {
anchorX: 0.5,
anchorY: 0.5,
Песочные часы, черный. 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.
Carrot, черный цвет. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.