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

#1 2007-11-09 20:30:05

Talaa
Scratcher
Registered: 2007-11-09
Posts: 2

How do you make a sprite jump?

Ive tried everything to make my sprite jump and im beginning to think that its not possible, can anyone help me?

Offline

 

#2 2007-11-09 21:04:05

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: How do you make a sprite jump?

Your request is not specific enough for anyone to help.

Give a pointer to the project, so that people can download it and look at the code.

Say *exactly* what you want your sprite to do.

Say what the sprite is doing instead.

Then someone may be able to help you debug.  Obviously, there are a lot of sprites that jump, so it is possible, unless you have some unusual definition of "jump".

Offline

 

#3 2007-11-09 21:16:56

Talaa
Scratcher
Registered: 2007-11-09
Posts: 2

Re: How do you make a sprite jump?

the act of my sprite going up and down, using the arrow key i cant show it to you cause i deleted it cause it wasnt working.

Offline

 

#4 2007-11-09 22:17:28

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

Re: How do you make a sprite jump?

Here is a basic jumping code you can try

<when[ up arrow  ]key pressed>
<repeat( 10
<change y by( 5
<repeat( 10
<change y by( -5
<end>


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

 

#5 2007-11-09 22:30:45

music_man
Scratcher
Registered: 2007-09-22
Posts: 100+

Re: How do you make a sprite jump?

You could also try to make it like this:

<when green flag clicked>
<forever if>  <key[  Up arrow  ]pressed?>
<repeat(  10
<change y by(  5
<repeat until>  <touching color[  Your color
<change y by(  -5
<end>

See if that works for you.   smile

Last edited by music_man (2007-11-09 22:32:15)


The fool has said in his heart, "There is no God."...  Psalms 14:1

Offline

 

Board footer