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

#1 2009-10-14 18:49:24

steppenwulf
Scratcher
Registered: 2009-07-23
Posts: 1000+

Can someone tell me a good jumping script please?

I need a jumping script for the character in my game.


I'm graduating HS this April and going to college in the Fall.

Offline

 

#2 2009-10-14 18:51:10

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Can someone tell me a good jumping script please?

Use the many tutorials. Google search or just:click here


Hai.

Offline

 

#3 2009-10-14 18:58:22

steppenwulf
Scratcher
Registered: 2009-07-23
Posts: 1000+

Re: Can someone tell me a good jumping script please?

Thank you fg123  big_smile


I'm graduating HS this April and going to college in the Fall.

Offline

 

#4 2009-10-14 18:59:13

floatingmagictree
Scratcher
Registered: 2008-10-21
Posts: 1000+

Re: Can someone tell me a good jumping script please?

Use velocities for this. You'll need a variable called Yvelocity.

Code:

<when green flag clicked>
<set [Yvelocity] to (0)>
<forever>
[ ]<if <touching [ground]>>
[ ][ ]change [Yvelocity]by [15]
[ ][ ][ ]<if <key [up arrow] pressed?>>
[ ][ ][ ][ ]<set [Yvelocity] to [15]>
[ ]<change y by (Yvelocity)>
[ ]<change [Yvelocity] by [-1]>

There you go. The 15 can be changed to any value. That will change how far the sprite will jump.

EDIT: Darn, fg123 beat me to it.

Last edited by floatingmagictree (2009-10-14 19:00:02)

Offline

 

#5 2009-10-14 19:04:31

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Can someone tell me a good jumping script please?

He, He. Hey, now every body is using illusionist's code!


Hai.

Offline

 

#6 2009-10-14 19:23:06

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Can someone tell me a good jumping script please?

I made that script first.
http://scratch.mit.edu/projects/archmage/72848


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#7 2009-10-14 19:32:55

floatingmagictree
Scratcher
Registered: 2008-10-21
Posts: 1000+

Re: Can someone tell me a good jumping script please?

archmage wrote:

I made that script first.
http://scratch.mit.edu/projects/archmage/72848

Yeah, archmage did, then demosthenes made a Sticky thread called Velocity (it's not stickied anymore).

Offline

 

#8 2009-10-14 22:37:04

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Can someone tell me a good jumping script please?

Because it got too crowded. But it is added into cheddargirl's PROGRAM IT! post/topic.


Hai.

Offline

 

#9 2009-10-15 09:25:54

steppenwulf
Scratcher
Registered: 2009-07-23
Posts: 1000+

Re: Can someone tell me a good jumping script please?

Thank you everyone for your help, I really appriciate it.  smile


I'm graduating HS this April and going to college in the Fall.

Offline

 

Board footer