Write the steps to how to create jumping game in scratch.
Answers
Explanation:
Jumping
There are many ways to make a sprite appear to jump, depending on how you want a sprite to and how realistic it looks. This article contains a number of them, categorized from least-realistic to most realistic. The ↑ key is usually used for jumping in games, but sometimes Space, Z,X,W, or even the mouse is used for jumping.
Contents
1Simple jumping
2Falling
3Limited Jumps
4More Realistic Jumping
5Physically Accurate Jumping
5.1With Ground Detection
5.2Without Ground Detection
6See Also
Simple jumping
The following is commonly used in animations and results in a sprite effectively teleporting upwards, and then downwards again.
whenclickedforeverifkeyup arrowpressed?thenchangeyby50wait0.5secschangeyby-50typical jumping key
The below script results in the sprite moving up if the up arrow is pressed.
whenclickedforeverifkeyup arrowpressed?thenchangeyby5typical jumping key
It was used in the Scrolling Demo project by SampleProjectsTeam.
Another jumping method which works very effectively and realistic is this.
whenclickedforeverifkeyup arrowpressed?thenrepeat10changeyby20repeat10changeyby-20typical jumping key
This is very fast but you can adjust the speed by adding a "wait block" before the "change y" block.
Falling
The following script "teleports" the sprite upwards, and then has it fall back down at a constant rate, until it lands on a platform.
whenclickedforeverifkeyup arrowpressed?thenchangeyby50repeatuntiltouchingcolor?