Code edit (2 edits merged)
Please save this source code
User prompt
Создать cannon2 по аналогии с: var cannon = new Cannon(); cannon.x = -100; // Position at the bottom left of the screen cannon.y = 2660; game.addChild(cannon);
User prompt
Please fix the bug: 'TypeError: undefined is not an object (evaluating 'cannon2.x')' in or related to this line: 'if (cannon2.x > 2048 - 100) {' Line Number: 275
User prompt
Please fix the bug: 'TypeError: undefined is not an object (evaluating 'cannon2.x')' in or related to this line: 'if (cannon2.x > 2048 - 100) {' Line Number: 275
User prompt
Please fix the bug: 'TypeError: undefined is not an object (evaluating 'cannon2.x')' in or related to this line: 'if (cannon2.x > 2048 - 100) {' Line Number: 275
User prompt
Исправить ошибку, когда cannon2 не видно за задним фоном
User prompt
Добавить cannon 2 в правой нижней части экрана
Code edit (3 edits merged)
Please save this source code
User prompt
Пушка появляется слева за экраном и двигается на расстояние x = 100
User prompt
Оружие появляется слева за экраном и двигается направо. Останавливаются на расстоянии по x 100
Code edit (1 edits merged)
Please save this source code
User prompt
Добавить cannon в нижней левой части экрана
User prompt
При столкновении с противником добавить флешскрин красный
User prompt
При смерте, добавить флешскрин красный
User prompt
Пересечение игрока и противника проверяться по координатам 100 на 100
User prompt
Please fix the bug: 'TypeError: enemyPlanes[i].getAsset is not a function. (In 'enemyPlanes[i].getAsset('enemy')', 'enemyPlanes[i].getAsset' is undefined)' in or related to this line: 'if (plane1.intersects(enemyPlanes[i].getAsset('enemy'))) {' Line Number: 247
User prompt
Исправить ошибку, когда игрок и противник не пересеклись, но наступил конец игры
User prompt
Please fix the bug: 'TypeError: enemyPlanes[i].getAsset is not a function. (In 'enemyPlanes[i].getAsset('enemy')', 'enemyPlanes[i].getAsset' is undefined)' in or related to this line: 'if (plane1.intersects(enemyPlanes[i].getAsset('enemy'))) {' Line Number: 247
User prompt
Пересечение игрока по изображению, а не объекту
User prompt
Про пересечении игрока и противника смерть
User prompt
Удалить выстрелы
User prompt
Fix the issue where the bullet stays at its spawn point
User prompt
Fix the issue where the bullet stays at its spawn point
User prompt
Fix the issue where the bullet stays at its spawn point
User prompt
Исправить ошибку, когда пуля не летит, а остается на месте вылета
===================================================================
--- original.js
+++ change.js
@@ -137,8 +137,13 @@
var cannon = new Cannon();
cannon.x = -100; // Position at the bottom left of the screen
cannon.y = 2660;
game.addChild(cannon);
+//create a cannon2
+var cannon2 = new Cannon2();
+cannon2.x = 2000; // Position at the bottom left of the screen
+cannon2.y = 2660;
+game.addChild(cannon2);
// Create the rest of the enemy planes every 2 seconds for the first 7 seconds
var enemySpawnTimer = LK.setInterval(function () {
enemyPlane = new EnemyPlane();
enemyPlane.x = 2150;
@@ -252,18 +257,9 @@
// Trigger game over
LK.showGameOver();
}
}
- // Create a second cannon
- var cannon2 = new Cannon();
- cannon2.x = -100; // Position at the bottom left of the screen
- cannon2.y = 2660;
- game.addChild(cannon2);
- // Move the first cannon from off-screen to x = 100
+ // Move the cannon from off-screen to x = 100
if (cannon.x < 100) {
cannon.x += 2;
}
- // Move the second cannon from off-screen to x = 100
- if (cannon2.x < 100) {
- cannon2.x += 2;
- }
});
\ No newline at end of file
снаряд от пушки. 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.