Game | Part 3 — Physics: Gravity, Jumping, and Landing on Objects
1. Gravity
2. Jumping
Press the up arrow key if you have a keyboard or click (touch) the up arrow button on the screen if you have a touch screen device.
3. Landing On Objects
Jump onto the object to land on top of it.
4. Landing On Multiple Objects
Conslusion
In the following post we will abstract the entity objects that we are landing on into two separate forms: enemies and platforms.
The user will be able to land on top of platforms with the same behavior as seen in section 4 of this blog post.
We'll give our enemies the ability to move. We'll also add functionality where if the user jumps on top of the enemy then it kills the enemy. If the enemy walks into or jumps on top of the user, then our user will die.