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

#1 2011-03-20 17:01:09

minihydro
Scratcher
Registered: 2011-03-16
Posts: 50

Jumping

hi how can you make a character jump up like a proper game like

call of duty
grand theft auto
halo
etc


i want a game where you jump like game like ive seen many games in scartch like that but how do you do it?


a help will be like a bunch of Gold

Offline

 

#2 2011-03-20 17:41:45

minihydro
Scratcher
Registered: 2011-03-16
Posts: 50

Re: Jumping

can you help pls i want the game to jump properly

Offline

 

#3 2011-03-21 09:56:04

minihydro
Scratcher
Registered: 2011-03-16
Posts: 50

Re: Jumping

help

Offline

 

#4 2011-03-21 10:36:39

throughthefire
Scratcher
Registered: 2009-07-09
Posts: 1000+

Re: Jumping

Are you talking about first person jumping? Because I would have usually expected you to mention Super Mario Bros!
Anyway, there are multiple ways that you could to it. One way would be to have a variable called "yspeed", and, for example, when the up arrow is pressed, you would have this script:
[blocks]
<when[ up arrow ]key pressed>
<repeat( 10
<change{ yspeed }by( 1
<end>
<wait( 1 )secs>
<repeat( 10
<change{ yspeed }by( -1
<end>
[/blocks]
And you would also have a script like this:
[blocks]
<when green flag clicked>
<set{ yspeed }to( 0
<forever>
<change y by( <{ yspeed }>
<end>
[/blocks]

Does that help you?

Last edited by throughthefire (2011-03-21 10:38:10)


Back. For now. Maybe.

Offline

 

#5 2011-03-21 15:07:59

minihydro
Scratcher
Registered: 2011-03-16
Posts: 50

Re: Jumping

that doesnt work it jumps up but doesnt come down

Offline

 

#6 2011-03-21 15:34:22

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Jumping

Here, this is what I would use:
http://i55.tinypic.com/vslx88.gif
Make the "if touching ____" into whatever your ground is, if it's a color, make that "if touching color (ground color)" or if it's a sprite, make it "if touching (ground sprite)".

Last edited by Kileymeister (2011-03-21 15:34:33)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#7 2011-03-24 14:30:49

minihydro
Scratcher
Registered: 2011-03-16
Posts: 50

Re: Jumping

ok i done that but now i want to make the sprite come back down with the force of gravity because if i hold onto to

<key[ UP ]pressed?>    then it looks like you arent going down your just flying up & up

Offline

 

#8 2011-03-24 14:37:09

floppy_gunk
Scratcher
Registered: 2008-11-14
Posts: 500+

Re: Jumping

Use Kiley's script, but replace
[blocks]
<key[ up arrow ]pressed?>
[/blocks]
with
[blocks]
<< <key[ up arrow ]pressed?> <and> touching the ground >>
[/blocks]
Substitute 'touching the ground' with whatever script you you for testing if the sprite is touching the ground.


http://img163.imageshack.us/img163/1917/2856lg.jpg Get it now!  smile

Offline

 

#9 2011-03-24 14:48:30

minihydro
Scratcher
Registered: 2011-03-16
Posts: 50

Re: Jumping

i dont that but if you hold the key up buttun it goes up higher and higher



search a game called 200 levels on scartch and you'll what i mean.

Offline

 

#10 2011-03-24 15:19:56

minihydro
Scratcher
Registered: 2011-03-16
Posts: 50

Re: Jumping

i done that but if you hold the key up then you can stay up in the game

BUT

i dont want it like that i want that if you press up then the character goes about 4cm up (just a example) and immediately come down instead of going up and staying up if you hold on to the key.

Offline

 

#11 2011-03-24 15:31:23

Reverberated3
Scratcher
Registered: 2011-02-24
Posts: 100+

Re: Jumping

Check your "ground" sprite, make sure you're not touching it all the time.


http://i53.tinypic.com/2zs0bah.jpghttp://i51.tinypic.com/30jtrbl.jpg

Offline

 

#12 2011-03-24 19:08:02

shigrammer
Scratcher
Registered: 2011-02-14
Posts: 8

Re: Jumping

http://www.scratch.mit.edu/ext/youtube/?v=u13BSy5rCWI

Offline

 

Board footer