User prompt
бонус появляется каждую тысячу очков
User prompt
бонус действует 15 секунд
User prompt
враги появляются через 5 секунд после смерти
User prompt
враги возрождаются через 5 секунд после смерти
User prompt
Please fix the bug: 'TypeError: setTimeout is not a function' in or related to this line: 'setTimeout(function () {' Line Number: 365
User prompt
враги восстанавливаются через 5 секунд
User prompt
бонус дает машине возможность убивать врагов
User prompt
добавь бонус
User prompt
игрок может убить врага только когда съест бонус
User prompt
враги восстанавливаются через 5 секунд после смерти
User prompt
добавь бонус который дает игроку способность убивать врагов на 30 секунда
User prompt
сделай так чтобы assets enemy и enemy2 менялись каждую секунду
User prompt
сделай так чтобы assets enemy и enemy2 менялись каждую секунду
User prompt
сделай так чтобы assets enemy и enemy2 менялись каждую секунду
User prompt
car asset невеидимый
User prompt
сделай так чтобы assets car и car2 менялись каждую секунду
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'update')' in or related to this line: 'car.update();' Line Number: 212
User prompt
change assets car and car 2 every second
Code edit (1 edits merged)
Please save this source code
User prompt
сделай так чтобы машина меняла свой вид между car и car2
User prompt
сделай анимацию из car и car2
Code edit (1 edits merged)
Please save this source code
Initial prompt
Kostya's dinner
===================================================================
--- original.js
+++ change.js
@@ -4,24 +4,15 @@
//<Assets used in the game will automatically appear here>
// Car class
var Car = Container.expand(function () {
var self = Container.call(this);
- self.carGraphics = self.attachAsset('car', {
+ var carGraphics = self.attachAsset(currentCarAsset, {
anchorX: 0.5,
anchorY: 0.5
});
- self.car2Graphics = self.attachAsset('car2', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.car2Graphics.visible = false;
self.speed = 5;
self.direction = 0; // 0: straight, 1: left, 2: right
self.update = function () {
- if (LK.ticks % 2 === 0) {
- self.carGraphics.visible = !self.carGraphics.visible;
- self.car2Graphics.visible = !self.car2Graphics.visible;
- }
if (self.direction === 1) {
self.rotation -= 0.05;
} else if (self.direction === 2) {
self.rotation += 0.05;
@@ -171,12 +162,20 @@
livesTxt.anchor.set(1, 0); // Sets anchor to the right of the top edge of the text.
LK.gui.topRight.addChild(livesTxt); // Add the lives text to the GUI overlay at the top right of the screen.
var enemyScore = 0;
// Initialize variables
-var car = new Car();
-car.x = 2048 / 2;
-car.y = 2732 / 2;
-game.addChild(car);
+var car;
+var currentCarAsset = 'car';
+var switchCarTimer = LK.setInterval(function () {
+ if (car) {
+ car.destroy();
+ }
+ car = new Car();
+ car.x = 2048 / 2;
+ car.y = 2732 / 2;
+ game.addChild(car);
+ currentCarAsset = currentCarAsset === 'car' ? 'car2' : 'car';
+}, 1000);
var spirals = [];
var enemies = [];
for (var i = 0; i < 3; i++) {
var enemy = new Enemy();
poop heart. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
red color
poop. 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.
magic poop. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.