This is a simple jumping game(not a game at all) developed on the process of learning CSS Keyframes and Javascript.
To beginner's those who want to understand the concept. I've used nested <div> tag. setInterval() is used for two things.
- for updateScore (updating score every 100 millisecond).
- for isAlive (to check whether the character collide with object).
setTimeout() is used for clearing animation. Since animation time is 500 millisecond, we set 500 millisecond in the function.
Yeah, I know my code may look ugly. Any suggestions are welcomed.
E-Mail: amr15336@gmail.com