Mario Jump is an additictive game inspired by Doodle Jump.
- Vanilla JavaScript
- HTML5 Canvas
- CSS
- Use left arrow key or A key to move player left
- Use right arrow key or D key to move player right
- Use M to toggle music
- The player performs a super jump when landing on blue platforms
- The player performs a super jump when landing on brown platforms
onCollide() {
if (this.type === 1) {
powerJump.play();
setTimeout(()=> {
powerJump.pause();
powerJump.load();
}, 3000);
this.game.player.fallStop();
this.game.player.jumpSpeed = 50;
}
this.game.player.fallStop();
};
checkFall() {
if (this.Y < height - this.height) {
this.setPosition(this.X, this.Y + this.fallSpeed);
this.fallSpeed++;
} else {
this.game.gameOver();
}
}
- This determines if the player has not landed on the platform.