User prompt
fixed enemies speed 1
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'angle')' in or related to this line: 'self.angle = Math.random() * 2 * Math.PI;' Line Number: 192
User prompt
random line trajectory enemies
User prompt
random thraectory enemies
Code edit (1 edits merged)
Please save this source code
User prompt
lower speed enemies
User prompt
add enemies that steel poop
User prompt
max limit poop at one time is 3
User prompt
The score in the game not depends on Time Elapsed
User prompt
The car cannot leave the game area
User prompt
score raise after collect poop
User prompt
poop spawns randomly after collect
User prompt
replace score up
User prompt
add score at the center
User prompt
first poop spawns in right anle
User prompt
player collect poop and it spawns in other place
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: 122
User prompt
add poops that player must collect and get points
User prompt
at the start car in center
User prompt
delete obstackles
User prompt
add road on background
User prompt
add random spiral road
Initial prompt
F & F
===================================================================
--- original.js
+++ change.js
@@ -29,8 +29,16 @@
self.straighten = function () {
self.direction = 0;
};
});
+// Poop class
+var Poop = Container.expand(function () {
+ var self = Container.call(this);
+ var poopGraphics = self.attachAsset('poop', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+});
// Spiral class
var Spiral = Container.expand(function () {
var self = Container.call(this);
self.radius = 100;
@@ -88,22 +96,33 @@
};
// Update game state
game.update = function () {
car.update();
- // Create spirals
+ // Create spirals and poops
if (LK.ticks % 60 === 0) {
var spiral = new Spiral();
spiral.x = 2048 / 2;
spiral.y = -100;
spirals.push(spiral);
game.addChild(spiral);
+ var poop = new Poop();
+ poop.x = Math.random() * 2048;
+ poop.y = -100;
+ spirals.push(poop);
+ game.addChild(poop);
}
- // Update spirals
+ // Update spirals and poops
for (var i = spirals.length - 1; i >= 0; i--) {
spirals[i].update();
if (car.intersects(spirals[i])) {
- LK.effects.flashScreen(0xff0000, 1000);
- LK.showGameOver();
+ if (spirals[i] instanceof Poop) {
+ spirals[i].destroy();
+ spirals.splice(i, 1);
+ score += 10;
+ } else {
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.showGameOver();
+ }
}
}
// Update score
score += 1;
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.