User prompt
Bg=grey
User prompt
Bg=Fly88
User prompt
Add 2 red lines in the middle of game
User prompt
Add 2 lines in the middle of game
User prompt
Bg=grey
User prompt
Bg=cyan
User prompt
At lines in the middle of game
User prompt
Add 2 black lines in the bottom
User prompt
Add 2 black lines in the middle of the game
User prompt
Add 2 lines in the middle of game
User prompt
Bg=grey
User prompt
Bg=black and white
User prompt
Bg=road
User prompt
Bg = light blue
User prompt
Bg = road
User prompt
Score = rock disappears
User prompt
If hero touch rock it disappears
User prompt
Decrease the quantity of obstacle
User prompt
Add rocks
User prompt
Remove rocks
User prompt
Rock = less quantity
User prompt
Increase the quantity of obstacle
User prompt
Les the rock
User prompt
Less rock
User prompt
Decrease in the quantity of rocks
===================================================================
--- original.js
+++ change.js
@@ -63,22 +63,8 @@
self.down = function (x, y, obj) {
hero.x += hero.speed;
};
});
-var Rock = Container.expand(function () {
- var self = Container.call(this);
- var rockGraphics = self.attachAsset('rock', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.speed = 4;
- self.update = function () {
- self.y += self.speed;
- if (self.y > 2732) {
- self.destroy();
- }
- };
-});
/****
* Initialize Game
****/
@@ -125,29 +111,18 @@
// Update obstacles
for (var i = obstacles.length - 1; i >= 0; i--) {
obstacles[i].update();
if (hero.intersects(obstacles[i])) {
- if (obstacles[i] instanceof Rock) {
- obstacles[i].destroy();
- obstacles.splice(i, 1);
- score += 10; // Increase score by 10 when hero touches a rock
- scoreTxt.setText(score); // Update score text
- } else {
- LK.effects.flashScreen(0xff0000, 1000);
- LK.showGameOver();
- }
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.showGameOver();
}
}
// Spawn new obstacles
if (LK.ticks % 20 == 0) {
for (var j = 0; j < 2; j++) {
// Spawn two obstacles at a time
var newObstacle;
- if (Math.random() > 0.7) {
- newObstacle = new Obstacle();
- } else {
- newObstacle = new Rock();
- }
+ newObstacle = new Obstacle();
newObstacle.x = Math.random() * 2048;
newObstacle.y = 0;
obstacles.push(newObstacle);
game.addChild(newObstacle);
Right button. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Road. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Road Car. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Coin. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.