User prompt
самолет не может пересечь пол и потолок
User prompt
при пересечении стены, самолет появляется на другой стороне стены
User prompt
выстрелы появляются из начала самолета и летят по направлению движения со скоростью в два раза быстрее скорости самолета
User prompt
выстрелы летят по направлению самолета
User prompt
добавить выстрелы из самолета
User prompt
не важно нажимают на левую часть экрана или правую, самолет всегда летит вращается против своей оси
User prompt
при нажатии на экран, изображение самолета вращается вокруг свой оси
User prompt
самолет сразу двигается
User prompt
если самолет задел потолок или пол, то game over
User prompt
самолет появляется в левой части экрана
User prompt
создать класс plane1
User prompt
Please fix the bug: 'Uncaught ReferenceError: Plane is not defined' in or related to this line: 'var plane1 = new Plane();' Line Number: 40
User prompt
delete Plane class
User prompt
plane1 появляется в правой стороне экрана
User prompt
Please fix the bug: 'ReferenceError: plane1 is not defined' in or related to this line: 'plane1.update();' Line Number: 87
User prompt
delete plane, not plane1
User prompt
исправить баг, когда отображется второй маленький самолет
User prompt
удалить маленький самолетик, рядом с основным самолетом
User prompt
пули вылетают из картинки самолета из точки Y = 60 X=200 относительно картинки
User prompt
пули вылетают по направлению движения из переда самолета
User prompt
пули вылетают по направлению движения
User prompt
сделать скорость пуль 20
User prompt
пули выстреливают из самолета раз в секунду
User prompt
исправить баг, когда пули не вылетают из самолета
User prompt
сделать автоатаку выстрелов
/**** * Classes ****/ // Bullet class var Bullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset('bullet', { width: 10, height: 20, color: 0xffffff, shape: 'box' }); self.speed = -20; // Move bullet self.move = function () { self.x += self.speedX; self.y += self.speedY; }; }); /**** * Initialize Game ****/ // Assets are automatically created based on usage in the code. var game = new LK.Game({ backgroundColor: 0xffffff // Init game with white background }); /**** * Game Code ****/ var bullets = []; // Global array to keep track of bullets // Create a plane // Set up game tick LK.on('tick', function () { plane1.update(); // Planes shoot bullets once per second if (LK.ticks % 60 == 0) { plane1.shoot(); } // Update and check bullets for (var i = bullets.length - 1; i >= 0; i--) { bullets[i].move(); // Check for bullet collision with planes if (bullets[i].intersects(plane1)) { // For simplicity, just remove the bullet on collision bullets[i].destroy(); bullets.splice(i, 1); } else if (bullets[i].y < -50 || bullets[i].y > 2782) { // Remove off-screen bullets bullets[i].destroy(); bullets.splice(i, 1); } } }); // Flags to track if the screen is being touched var isTouchingLeft = false; var isTouchingRight = false; // Change plane direction when the screen is touched game.on('down', function (obj) { var pos = obj.event.getLocalPosition(game); // If touch is on the left half of the screen, set isTouchingLeft to true if (pos.x < 1024) { isTouchingLeft = true; } else { // If touch is on the right half, set isTouchingRight to true isTouchingRight = true; } }); // Stop changing plane direction when the screen is no longer being touched game.on('up', function (obj) { isTouchingLeft = false; isTouchingRight = false; }); // In the game tick, change plane direction while the screen is being touched 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) * 5; plane1.speedY = Math.sin(angle) * 5; } else if (isTouchingRight) { 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) * 5; plane1.speedY = Math.sin(angle) * 5; } });
===================================================================
--- original.js
+++ change.js
@@ -30,18 +30,8 @@
* Game Code
****/
var bullets = []; // Global array to keep track of bullets
// Create a plane
-var plane1 = new Plane();
-plane1.x = 200;
-plane1.y = 2532;
-plane1.speedX = 5;
-plane1.speedY = 0;
-plane1.attachAsset('plane', {
- color: 0x0000ff
-}); // Blue color for plane1
-// Add plane1 to the game
-game.addChild(plane1);
// Set up game tick
LK.on('tick', function () {
plane1.update();
// Planes shoot bullets once per second
снаряд от пушки. 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.