User prompt
золотая какашка заставляет врагов остановиться на месте на 10 секунд
Code edit (5 edits merged)
Please save this source code
User prompt
добавь золотую какашку которая отключает врагов на 10 секунд и приносит 1000 очков
User prompt
добавь зеленую какашку которая убивает врагов на 10 секунд если они ее соберут
User prompt
игрок мигает красным если меньше жизней
User prompt
игрок мигает красным при уроне
User prompt
жизни мигают перед исчезновением
User prompt
жизни исчезают через три секунды
User prompt
жизни пропадают через 2 секунды после появления
User prompt
Please fix the bug: 'TypeError: spirals[i].update is not a function' in or related to this line: 'spirals[i].update();' Line Number: 231
User prompt
добавь случайное появление жизней
User prompt
отнимай жизни у игрока если враги собрали какашки
User prompt
почини счетчик жизней
User prompt
враги не отнимают очки но отнимают жизни
User prompt
у игрока 10 жизней отнимай дну жизнь если враг украл какашку
Code edit (2 edits merged)
Please save this source code
User prompt
отнимай очки у игрока если он не собрал какашку
Code edit (1 edits merged)
Please save this source code
User prompt
игра начинается со 100 очков
User prompt
если очки станут равны нулю игра закончится
User prompt
отнимай 100 очков если враги украли какашку
User prompt
показывай очки игрока сверху синим цветом
User prompt
за каждую какашку игрок получает 100 очков
User prompt
удали счетчики
User prompt
почини счетчики, они не работают
===================================================================
--- original.js
+++ change.js
@@ -88,8 +88,20 @@
}
}
};
});
+// Life class
+var Life = Container.expand(function () {
+ var self = Container.call(this);
+ var lifeGraphics = self.attachAsset('life', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.reposition = function () {
+ self.x = Math.random() * 2048;
+ self.y = Math.random() * 2732;
+ };
+});
// Poop class
var Poop = Container.expand(function () {
var self = Container.call(this);
var poopGraphics = self.attachAsset('poop', {
@@ -195,11 +207,19 @@
spirals.push(poop);
game.addChild(poop);
}
}
- // Update spirals, poops and enemies
+ // Add life instances to the game
+ if (LK.ticks % 600 === 0) {
+ // every 10 seconds
+ var life = new Life();
+ life.reposition();
+ spirals.push(life);
+ game.addChild(life);
+ }
+ // Update spirals, poops, lives and enemies
for (var i = spirals.length - 1; i >= 0; i--) {
- if (spirals[i] instanceof Spiral) {
+ if (spirals[i] instanceof Spiral || spirals[i] instanceof Life) {
spirals[i].update();
}
if (car.intersects(spirals[i])) {
if (spirals[i] instanceof Poop) {
@@ -218,8 +238,15 @@
spirals[i].y = Math.random() * 2732;
playerLives -= 1; // Decrease player lives by 1 when enemy collects poop
livesTxt.setText('Lives: ' + playerLives); // Update the displayed lives
}
+ } else if (spirals[i] instanceof Life) {
+ if (car.intersects(spirals[i])) {
+ spirals[i].destroy();
+ spirals.splice(i, 1);
+ playerLives += 1; // Increase player lives by 1 when life is collected
+ livesTxt.setText('Lives: ' + playerLives); // Update the displayed lives
+ }
} else {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
toilet room background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
fly
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.
сердце-какашка. 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.