User prompt
make collider around player 70% smaller
User prompt
make collider around player 30% smaller
User prompt
make colliders around obstacles 20% smaller
User prompt
Fix Bug: 'Timeout.tick error: Can't find variable: scoreTxt' in this line: 'scoreTxt.setText(this.score.toString());' Line Number: 34
User prompt
Score should increment with every successful jump
User prompt
Fix Bug: 'Timeout.tick error: Can't find variable: score' in this line: 'score++;' Line Number: 32
User prompt
Fix Bug: 'Timeout.tick error: Can't find variable: score' in this line: 'score++;' Line Number: 32
User prompt
Score should increment by 1 for every successful jump
User prompt
Player should be red
User prompt
Background above ground should be light blue
User prompt
Jump should reach 10% higher
User prompt
Move ground down 100 pixels
User prompt
Decrease ground graphics height by 20%
User prompt
Move ground graphics down 20%
User prompt
Make ground graphics green
User prompt
Move ground graphics down by 20%
User prompt
Move ground graphics down by 50%
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'player.y')' in this line: 'groundGraphics.height = 2732 - player.y;' Line Number: 40
var Hurdle = Container.expand(function () {
var self = Container.call(this);
var hurdleGraphics = self.createAsset('hurdle', 'Hurdle Graphics', .5, .5);
self.speed = -5;
self.move = function () {
self.x += self.speed;
};
});
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.createAsset('player', 'Player Graphics', .5, .5);
self.jump = function () {
if (self.y === 2000) {
var jumpHeight = 300;
var jumpSpeed = 10;
var jumpTick = 0;
var rotationSpeed = 0.1;
var jumpingInterval = LK.setInterval(function () {
if (jumpTick < jumpHeight) {
self.y -= jumpSpeed;
jumpTick += jumpSpeed;
self.rotation += rotationSpeed;
} else if (self.y < 2000) {
self.y += jumpSpeed;
self.rotation += rotationSpeed;
}
if (self.y >= 2000) {
self.y = 2000;
self.rotation = 0;
LK.clearInterval(jumpingInterval);
}
}, 21);
}
};
});
var Game = Container.expand(function () {
var self = Container.call(this);
var player = self.addChild(new Player());
player.x = 200;
player.y = 2000;
var groundGraphics = self.createAsset('ground', 'Ground Graphics', 0, 1);
groundGraphics.width = 2048;
groundGraphics.height = 2732 - player.y;
groundGraphics.y = player.y;
var hurdles = [];
LK.on('tick', function () {
for (var a = hurdles.length - 1; a >= 0; a--) {
if (hurdles[a]) {
hurdles[a].move();
if (hurdles[a].x < -50) {
hurdles[a].destroy();
hurdles.splice(a, 1);
}
if (player.intersects(hurdles[a])) {
LK.showGameOver();
}
}
}
if (LK.ticks % 96 == 0) {
var newHurdle = new Hurdle();
newHurdle.x = 2048;
newHurdle.y = 2000;
hurdles.push(newHurdle);
self.addChild(newHurdle);
}
});
stage.on('down', function (obj) {
player.jump();
});
});