how do i make my character jump a desired height in my game?
Offline
There are a few ways to do that. I know of several. Probably the simplest way is to do this:
<when green flag clicked>
<forever if>
<< <key[ up ]pressed?> <and> <touching color[ >>
<repeat( 10
<change y by( 10
Last edited by calebxy (2010-06-30 12:29:59)
Offline
And then make gravity. Do that by doing this:
<when green flag clicked>
<forever if>
<< <not> <touching color[ >>
<change y by( -7
Offline
how do i make it so when i jump and hold the right arrow key down he keeps moving right away
Offline
calebxy's way is simple and works well, but it looks choppy.
First, make a variable called "velocity". Then use this script:
About your second question, to do that you need to make the jumping and movement 2 separate scripts. When you press the arrow keys while jumping you'll move, but it'll also work while you're on the ground.
Last edited by hmnwilson (2010-06-30 13:31:44)
Offline
how come when i press jump it stops my sprite and makes me have to press the arrow key again to keep moving?
Offline
never mind it works now thanks alot i think ive figured it out from here and ill give u guys credit when im done
Offline