User prompt
переместить счетчик в правый угол
Code edit (1 edits merged)
Please save this source code
User prompt
выводить количество очков в overlay
User prompt
создать счетчик очков, который каждую секунды прибавляет +1
User prompt
добавить таймер в верхней правый угол, который начинает с 0
User prompt
исправить ошибку, когда счетчик не отображается
User prompt
исправить ошибку, когда счетчик не отображается
Code edit (1 edits merged)
Please save this source code
User prompt
выводить счетчик в верхнем правом углу
Code edit (1 edits merged)
Please save this source code
User prompt
добавить счетчик, который каждую секунду прибавляет одно очко
User prompt
добавить секундомер в игру
User prompt
добавить секундомер в середину экрана черного цвета
User prompt
добавить секундомер в правый верхний угол черного цвета
User prompt
добавить таймер в правый верхний угол черного цвета
Code edit (1 edits merged)
Please save this source code
User prompt
самолеты противником плавно опускаются и плавно поднимаются на расстояние рандомное расстояние от 0 до 250 с одинакомым интервалом времени, через 25 секунд после начала матча
User prompt
самолеты противником плавно опускаются и плавно поднимаются на расстояние рандомное расстояние от 0 до 250 с одинакомым интервалом времени, через 5 секунд после начала матча
User prompt
самолеты противником плавно опускаются и плавно поднимаются на расстояние рандомное расстояние от 0 до 250 с одинакомым интервалом времени
User prompt
самолеты противником плавно опускаются и плавно поднимаются на расстояние 200 с одинакомым интервалом времени
User prompt
самолеты противником плавно опускаются и поднимаются на расстояние 200 с одинакомым интервалом времени
User prompt
самолеты противником плавно опускаются и поднимаются на расстояние 300
User prompt
самолеты противником плавно опускаются и поднимаются на расстояние 50 пикселей
User prompt
самолеты противником плавно опускаются и поднимаются на рандомное расстояние
User prompt
самолеты противников слева и справа опускаются и поднимаются на рандомное расстояние
===================================================================
--- original.js
+++ change.js
@@ -78,9 +78,9 @@
var planeGraphics = self.attachAsset('plane', {
anchorX: 0.5,
anchorY: 0.5
});
- self.speedX = 8;
+ self.speedX = 7;
self.speedY = 0;
// Update plane position
self.update = function () {
self.x += self.speedX;
@@ -112,8 +112,32 @@
/****
* Game Code
****/
+// Create a timer display in the top-right corner
+var timerTxt = new Text2('00:00', {
+ size: 100,
+ fill: "#000000" // Black color
+});
+// Position the timer text in the top-right corner of the screen
+timerTxt.anchor.set(1, 0); // Sets anchor to the right of the top edge of the text
+timerTxt.x = 2048; // Position at the right edge of the screen
+timerTxt.y = 0; // Position at the top of the screen
+// Add the timer text to the GUI overlay in the top-right corner
+LK.gui.topRight.addChild(timerTxt);
+// Initialize a variable to keep track of elapsed time in seconds
+var elapsedTime = 0;
+// Update the timer every second
+LK.setInterval(function () {
+ elapsedTime += 1;
+ // Convert elapsed time to minutes and seconds format
+ var minutes = Math.floor(elapsedTime / 60);
+ var seconds = elapsedTime % 60;
+ // Ensure double digits for both minutes and seconds
+ var formattedTime = (minutes < 10 ? '0' : '') + minutes + ':' + (seconds < 10 ? '0' : '') + seconds;
+ // Update the timer text
+ timerTxt.setText(formattedTime);
+}, 1000);
var background2 = game.attachAsset('background2', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1,
@@ -247,17 +271,17 @@
LK.on('tick', function () {
if (isTouchingLeft) {
var angle = Math.atan2(plane1.speedY, plane1.speedX);
angle -= Math.PI / 60; // Subtract 1.5 degrees (in radians) for counter-clockwise rotation
- plane1.speedX = Math.cos(angle) * 8;
- plane1.speedY = Math.sin(angle) * 8;
+ plane1.speedX = Math.cos(angle) * 7;
+ plane1.speedY = Math.sin(angle) * 7;
plane1.rotation -= Math.PI / 60; // Rotate the plane counter-clockwise
}
if (isTouchingRight && LK.ticks > 78) {
var angle = Math.atan2(plane1.speedY, plane1.speedX);
angle += Math.PI / 60; // Add 1.5 degrees (in radians) for clockwise rotation
- plane1.speedX = Math.cos(angle) * 8;
- plane1.speedY = Math.sin(angle) * 8;
+ plane1.speedX = Math.cos(angle) * 7;
+ plane1.speedY = Math.sin(angle) * 7;
plane1.rotation += Math.PI / 60; // Rotate the plane clockwise
}
// Check if the plane crosses the side boundaries of the screen, touches the top or bottom of the screen, or collides with the health_bar
if (plane1.x <= 70 || plane1.x >= 2170 - plane1.width || plane1.y <= 70 || plane1.y >= 2752 - plane1.height) {
снаряд от пушки. 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.