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

#1 2010-06-30 12:24:48

explosivedude
Scratcher
Registered: 2010-06-22
Posts: 64

how do i make my charactor jump

how do i make my character jump a desired height in my game?

Offline

 

#2 2010-06-30 12:27:32

calebxy
Scratcher
Registered: 2009-12-31
Posts: 1000+

Re: how do i make my charactor jump

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)


I'm making my own Doctor Who series!  big_smile  See the first episode here.
And please join Story Zone!  big_smile

Offline

 

#3 2010-06-30 12:28:58

calebxy
Scratcher
Registered: 2009-12-31
Posts: 1000+

Re: how do i make my charactor jump

And then make gravity. Do that by doing this:
<when green flag clicked>
<forever if>
<<  <not> <touching color[  >>
<change y by( -7


I'm making my own Doctor Who series!  big_smile  See the first episode here.
And please join Story Zone!  big_smile

Offline

 

#4 2010-06-30 13:25:14

explosivedude
Scratcher
Registered: 2010-06-22
Posts: 64

Re: how do i make my charactor jump

how do i make it so when i jump and hold the right arrow key down he keeps moving right away

Offline

 

#5 2010-06-30 13:29:57

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: how do i make my charactor jump

calebxy's way is simple and works well, but it looks choppy.

First, make a variable called "velocity". Then use this script:

http://www.freeimagehosting.net/uploads/73011a8a23.gif

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)


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#6 2010-06-30 13:42:04

explosivedude
Scratcher
Registered: 2010-06-22
Posts: 64

Re: how do i make my charactor jump

how come when i press jump it stops my sprite and makes me have to press the arrow key again to keep moving?

Offline

 

#7 2010-06-30 13:44:46

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: how do i make my charactor jump

That's weird, what script are you using for the movement?


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#8 2010-06-30 14:49:09

explosivedude
Scratcher
Registered: 2010-06-22
Posts: 64

Re: how do i make my charactor jump

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

 

Board footer