User prompt
Make obstacles move faster as time progresses
User prompt
Parse a speed variable to the obstacle move function
User prompt
Make sure to parse a speed variable to the move function of obstacles
User prompt
Parse a speed variable when calling move function on obstacles
User prompt
Define a fixed obstacle speed in the game class and use that when calling the move function on obstacles
User prompt
Set initial y speed of bird to -20
User prompt
Increase obstacle speed as the game progresses
User prompt
set obstacleSpawnY to -500
User prompt
Do not reset the y of obstacles in the obstacle move class
User prompt
If obstacles move off screen delete them from the obstacle array and destroy them
User prompt
Make sure checkObstacleCollision is called for both left and right obstacles
User prompt
Make the obstacle speed increase half as fast
User prompt
slowly decrease obstacleSpawnRandomness as the game progresses
User prompt
Make the code that test if obstacles should spawn test for >= rather than OO
User prompt
Add a score to the game, which counts up each time the bird bounce
User prompt
Make the score text impact and black
User prompt
make the score text colored 0291c3
User prompt
Increase the threshold value for obstacle removal check by 500px
User prompt
Remove the fixed added value on targetrotation
User prompt
Make the highscore color 3a84f7
User prompt
Add a obstacle graphics shadow inside the obstacles
User prompt
Make sure the obstacle graphic is attached above the shadow in obstacles
User prompt
Don't set alpha on obstacle shadows and move it down by 40px
User prompt
Make obstacles spawn behind the walls
User prompt
Make the walls render above the obstacles
===================================================================
--- original.js
+++ change.js
@@ -61,20 +61,20 @@
});
scoreText.anchor.set(.5, 0);
LK.gui.topCenter.addChild(scoreText);
var bird = self.addChild(new Bird());
- var leftWall = self.addChild(new Wall());
- leftWall.x = 0;
- leftWall.y = 1366;
- var rightWall = self.addChild(new Wall());
- rightWall.x = 2048;
- rightWall.y = 1366;
var leftObstacles = [], rightObstacles = [];
var obstacleSpawnRandomness = 120;
var obstacleSpawnRandomnessDecrease = 0.05;
var obstacleSpawnY = -500;
var leftObstacleSpawnTime = Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness;
var rightObstacleSpawnTime = Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness;
+ var leftWall = self.addChild(new Wall());
+ leftWall.x = 0;
+ leftWall.y = 1366;
+ var rightWall = self.addChild(new Wall());
+ rightWall.x = 2048;
+ rightWall.y = 1366;
bird.x = 1024;
bird.y = 1366;
stage.on('down', function (obj) {
bird.flap();
@@ -88,16 +88,16 @@
obstacleSpawnRandomness = 60;
}
if (LK.ticks >= leftObstacleSpawnTime) {
var newObstacle = self.addChild(new Obstacle());
- newObstacle.x = -newObstacle.width;
+ newObstacle.x = 0;
newObstacle.y = obstacleSpawnY;
leftObstacles.push(newObstacle);
leftObstacleSpawnTime += Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness;
}
if (LK.ticks >= rightObstacleSpawnTime) {
var newObstacle = self.addChild(new Obstacle());
- newObstacle.x = 2048 + newObstacle.width;
+ newObstacle.x = 2048;
newObstacle.y = -newObstacle.height;
rightObstacles.push(newObstacle);
rightObstacleSpawnTime += Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness;
}