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

#1 2010-01-17 22:11:02

tpg56
Scratcher
Registered: 2009-12-31
Posts: 4

Jumping on games

I was wondering, if I made a platforming game, how would I program my main sprite to jump?

Offline

 

#2 2010-01-17 22:12:35

zAmber
Scratcher
Registered: 2009-11-28
Posts: 10

Re: Jumping on games

hey guys i know this is spam but it would mean alot to me if u guys joined and rpged in my lost RPG.... it tok me hours to create last summer and id like to keep ti alive cuz its my only successful RP heres the link: http://scratch.mit.edu/galleries/view/55906 plz dont hate me for spam DX

Offline

 

#3 2010-01-17 22:33:05

game_freak42
Scratcher
Registered: 2009-09-04
Posts: 100+

Re: Jumping on games

tpg56 wrote:

I was wondering, if I made a platforming game, how would I program my main sprite to jump?

make variables: Gravity, Yvel, INAIR and Jump.
Ok do this:
<when green flag clicked>
<set{Gravity}to(-0.3)
<set{INAIR}to(0)
<set{Yvel}to(0)
<set{jump}to(3)
<forever>
<if><key[up arrow]pressed?> 
<if><touching color[Black]
<change{Yvel}by(<{Jump}>)
<end>
<if><<  <not><touching color[BLACK]>>
<set{INAIR}to(1)
<else>
<set{INAIR}to(0)
<end>
<if><(<{INAIR}>  <=> 1  )> 
<change{yvel}by(<{gravity}>)
<end>
<change y by(<{yvel}>)

Offline

 

#4 2010-01-17 22:53:31

cheddargirl
Scratch Team
Registered: 2008-09-15
Posts: 1000+

Re: Jumping on games

zAmber wrote:

hey guys i know this is spam but it would mean alot to me if u guys joined and rpged in my lost RPG.... it tok me hours to create last summer and id like to keep ti alive cuz its my only successful RP heres the link: http://scratch.mit.edu/galleries/view/55906 plz dont hate me for spam DX

Hey zAmber, it's great that you want to show us your gallery, but when you want to show other people your gallery, it isn't very nice to create an off-topic post on someone else's thread. Have you tried using the 'Show and Tell' forum? The 'Show and Tell' forum is a good place top share your gallery with others.  smile


http://i.imgur.com/8QRYx.png
Everything is better when you add a little cheddar, because when you have cheese your life is at ease  smile

Offline

 

#5 2010-01-18 01:08:05

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Jumping on games

Without velocity:
http://www.imagebeast.net/images/6m9f4covlgmnehgnh9w.png

With velocity:
http://www.imagebeast.net/images/6lwh5loz4yz03khokysr.png

Any questions?


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

Board footer