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;
game.update = function () {
tankTop.update();
tankBottom.update();
if (tankTop.intersects(tankBottom)) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
}; ===================================================================
--- original.js
+++ change.js
@@ -42,6 +42,12 @@
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
+game.update = function () {
+ tankTop.update();
+ tankBottom.update();
+ if (tankTop.intersects(tankBottom)) {
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.showGameOver();
+ }
+};
\ No newline at end of file