User prompt
сделай танкам ИИ чтобы они двигались и целились друг в друга
User prompt
сделай танкам коллизию
User prompt
сделай чтобы танки вращались по 360, а именно в сторону куда он едет
User prompt
сделай их немножко ближе к центру
User prompt
добавь 2 ассета tank сверху и снизу по одному
User prompt
добавь в центр игры asset place
User prompt
удали код
User prompt
сделай меню на весь экран и пусть на кнопке старт будет написано "start"
User prompt
пусть в меню будет 2 кнопки: "старт" и "выйти"
User prompt
сделай меню
User prompt
очисти код
User prompt
удали ассеты
User prompt
это просто фиолетовый квадрат, сделай настоящий меч
User prompt
сделай по середине экрана меч из майнкрафта
User prompt
загрузи 10 ассетов мечей в assets
User prompt
удали код
Initial prompt
ss
/**** * Classes ****/ var Tank = Container.expand(function () { var self = Container.call(this); var tankGraphics = self.attachAsset('tank', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { self.rotation += 0.01; }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Retrieve 'place' asset and set its anchor point to the center var placeAsset = LK.getAsset('place', { anchorX: 0.5, anchorY: 0.5 }); // Add 'place' asset to the game game.addChild(placeAsset); // Position 'place' asset at the center of the game placeAsset.x = 2048 / 2; placeAsset.y = 2732 / 2; // Create instances of the Tank class var tankTop = new Tank(); var tankBottom = new Tank(); // Add the tanks to the game game.addChild(tankTop); game.addChild(tankBottom); // Position the tanks at the top and bottom of the game tankTop.x = 2048 / 2; tankTop.y = 2732 / 4; tankBottom.x = 2048 / 2; tankBottom.y = 2732 * 3 / 4; tankTop.update(); tankBottom.update();
===================================================================
--- original.js
+++ change.js
@@ -1,5 +1,19 @@
/****
+* Classes
+****/
+var Tank = Container.expand(function () {
+ var self = Container.call(this);
+ var tankGraphics = self.attachAsset('tank', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.update = function () {
+ self.rotation += 0.01;
+ };
+});
+
+/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
@@ -17,21 +31,17 @@
game.addChild(placeAsset);
// Position 'place' asset at the center of the game
placeAsset.x = 2048 / 2;
placeAsset.y = 2732 / 2;
-// Retrieve 'tank' asset and set its anchor point to the center
-var tankAssetTop = LK.getAsset('tank', {
- anchorX: 0.5,
- anchorY: 0.5
-});
-var tankAssetBottom = LK.getAsset('tank', {
- anchorX: 0.5,
- anchorY: 0.5
-});
-// Add 'tank' assets to the game
-game.addChild(tankAssetTop);
-game.addChild(tankAssetBottom);
-// Position 'tank' assets at the top and bottom of the game
-tankAssetTop.x = 2048 / 2;
-tankAssetTop.y = 2732 / 4;
-tankAssetBottom.x = 2048 / 2;
-tankAssetBottom.y = 2732 * 3 / 4;
\ No newline at end of file
+// Create instances of the Tank class
+var tankTop = new Tank();
+var tankBottom = new Tank();
+// Add the tanks to the game
+game.addChild(tankTop);
+game.addChild(tankBottom);
+// Position the tanks at the top and bottom of the game
+tankTop.x = 2048 / 2;
+tankTop.y = 2732 / 4;
+tankBottom.x = 2048 / 2;
+tankBottom.y = 2732 * 3 / 4;
+tankTop.update();
+tankBottom.update();
\ No newline at end of file