This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-06-29 13:46:32

brgbdg9nanana
Scratcher
Registered: 2008-04-23
Posts: 19

How to make gravity and jumping

How to make gravity and jumping [blocks]<when green flag clicked>
<forever>
<change y by( <{ yvel }>
<if><<  <not><touching color[ color of ground  >>
<change{ yvel }by( -1
<else>
<set{ yvel }to( 0
<if><key[ up arrow ]pressed?>
<<change{ yvel }by( 13
<end>
<end>
<end> [/blocks] This script will only do jumping, not hitting anything but the ground or side to side movement.  smile  tongue  big_smile  lol  cool  wink  Full movement demo

Last edited by brgbdg9nanana (2008-06-30 10:51:09)


Brgbdg9nanana  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  smile  roll  big_smile  cool  lol  tongue Click here for an awesome stickman game! Need help with making a platforming game?

Offline

 

#2 2008-08-14 13:43:33

mletreat
Scratcher
Registered: 2008-05-01
Posts: 100+

Re: How to make gravity and jumping

Thanks for sharing...if you want to make a tutorial project with these tips I will add it to my How-To gallery  smile

Offline

 

Board footer