Code edit (1 edits merged)
Please save this source code
User prompt
уменьшить время между поворотами XVOST
User prompt
поворот XVOST сделать на равном расстоянии что влево, что в право
Code edit (1 edits merged)
Please save this source code
User prompt
направление движения хвоста всегда горизонтальное
User prompt
скорость xvost всегда равна 3
Code edit (2 edits merged)
Please save this source code
User prompt
наклон xvost происходит плавно в течении 0,5 секунд
User prompt
сделать наклоны XVOST влево и вправо на 10 градусов
User prompt
xvost наклоняется против часовой стрелки на 10 градусов в течении 0.5 секунд, затем возвращается в начальное положение в течении 0.5 секунд и потом поворачивается по часовой стрелки на 10 градусов в течении 0.5 секунд и возвращается обратно, и все это повторяется
Code edit (2 edits merged)
Please save this source code
User prompt
xvost может передвигаться только на расстоянии x от 100 до 1900, y от 2150 до 2600
User prompt
добавить объект XVOST, он двигается в случайном направлении в нижней части экрана
User prompt
добавить XVOST в левую часть экрана
User prompt
Please fix the bug: 'Uncaught ReferenceError: tap is not defined' in or related to this line: 'var originalScaleX = tap.scale.x;' Line Number: 155
User prompt
добавить XVOST в центр экрана
Code edit (1 edits merged)
Please save this source code
User prompt
исправить ошибку, когда dog не появляется после того как противник пересек нижнюю границу
User prompt
после того как утка пересекла нижнюю границу, в этом месте c задержкой 1 секунда появляется DOG на 2 секунды и потом удаляется
User prompt
Please fix the bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'x')' in or related to this line: 'dog.x = enemies[j].x;' Line Number: 214
User prompt
добавить задержку 1 секунду при появлении dog
User prompt
после того как утка пересекла нижнюю границу, в этом месте появляется DOG на 2 секунды и потом удаляется
User prompt
после того как утка пересекла нижнюю границу, в этом месте появляется DOG
Code edit (6 edits merged)
Please save this source code
User prompt
наклонить картинку napr на 10 градусов
===================================================================
--- original.js
+++ change.js
@@ -55,8 +55,22 @@
var dy = other.y - this.y;
return Math.sqrt(dx * dx + dy * dy);
};
});
+// XVOST class for the XVOST object that moves in a random direction at the bottom of the screen
+var XVOST = Container.expand(function () {
+ var self = Container.call(this);
+ var xvostGraphics = self.attachAsset('xvost', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = Math.random() * (6 - 4) + 4;
+ self.direction = Math.random() * 2 * Math.PI; // Random direction in radians
+ self.update = function () {
+ self.x += self.speed * Math.cos(self.direction);
+ self.y += self.speed * Math.sin(self.direction);
+ };
+});
/****
* Initialize Game
****/
@@ -118,16 +132,17 @@
anchorY: 0.5
});
weapon.x = 1024; // Center horizontally
weapon.y = 2632; // Bottom of the screen
-// Add 'XVOST' image to the left side of the screen
-var xvost = game.addChild(new Container());
-var xvostGraphics = xvost.attachAsset('xvost', {
+// Add 'Napr' image to the center of the screen
+var napr = game.addChild(new Container());
+var naprGraphics = napr.attachAsset('Napr', {
anchorX: 0.5,
anchorY: 0.5
});
-xvost.x = 100; // Left side of the screen
-xvost.y = 1366; // Center vertically
+napr.x = 1700; // Center horizontally
+napr.y = 2150; // Center vertically
+napr.rotation = 7 * (Math.PI / 180); // Rotate the image by 10 degrees
// Add 'Tap' image to the center of the screen
var tap = game.addChild(new Container());
var tapGraphics = tap.attachAsset('Tap', {
anchorX: 0.5,
@@ -174,8 +189,12 @@
LK.setTimeout(function () {
tap.visible = false;
tap.destroy();
}, 1650);
+// Add an XVOST object to the game
+var xvost = game.addChild(new XVOST());
+xvost.x = Math.random() * 2048; // Random position from 0 to 2048
+xvost.y = 2732 - xvost.height / 2; // Position at the bottom of the screen
// Main game loop
LK.on('tick', function () {
// Move bullets
for (var i = playerBullets.length - 1; i >= 0; i--) {
@@ -228,8 +247,10 @@
}
}
}
}
+ // Update the position of the XVOST object
+ xvost.update();
// Spawn enemies
if (enemySpawnTimer <= 0) {
spawnEnemy();
enemySpawnTimer = spawnEnemyInterval;
черный шар. 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.
вывеска на двух ниточках с надписью: TImakovDS. 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.