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

#1 2010-02-25 21:56:46

alexdent123
Scratcher
Registered: 2010-01-19
Posts: 8

How do i make a sprite jump?

Hello I am fairly new to scratch and was wondering how to make my sprite jump. I have seen archmages example of that on the forums but i need some other code on the <when green flag clicked> code line. I just want my sprite to jump up maybe 20-25 steps and then go down in about 3 or 4 seconds please someone help me!

Offline

 

#2 2010-02-26 00:09:16

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: How do i make a sprite jump?

Try this:

When space key pressed*
repeat 5
   change y by 5
endrepeat
repeat 25
   change y by -1
endrepeat

Does that work?

*assuming that you use the space key to jump.

Last edited by Chrischb (2010-02-26 00:09:38)


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#3 2010-02-26 22:11:11

alexdent123
Scratcher
Registered: 2010-01-19
Posts: 8

Re: How do i make a sprite jump?

can u use the up arrow instead of space key?

Offline

 

#4 2010-02-26 22:20:19

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: How do i make a sprite jump?

Yep! Just select Up Arrow instead of Space in the top block.  smile


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#5 2010-02-27 11:42:20

alexdent123
Scratcher
Registered: 2010-01-19
Posts: 8

Re: How do i make a sprite jump?

since im new to scratch could u mind using the little symbols like<when green flag clicked><change{  }by(
and so on 
Tythat would help me very much

Offline

 

#6 2010-02-27 11:44:18

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How do i make a sprite jump?

Here's a guide, there's a part about making a basic platformer. http://scratch.mit.edu/forums/viewtopic.php?id=30916


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#7 2010-02-27 11:57:51

alexdent123
Scratcher
Registered: 2010-01-19
Posts: 8

Re: How do i make a sprite jump?

actually i did it and it works but i have another question how do i make a standing platform that the sprite can jump onto?

Offline

 

#8 2010-02-27 12:01:53

alexdent123
Scratcher
Registered: 2010-01-19
Posts: 8

Re: How do i make a sprite jump?

@juststickman
what if i need to put more script in <when green flag clicked> than just those codes on ur forum i need to put
<when green flag clicked>
<go to x sad   )y sad 
<play sound[
<hide>
how could i add those in to your platforming script

Offline

 

#9 2010-02-27 12:10:19

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How do i make a sprite jump?

alexdent123 wrote:

@juststickman
what if i need to put more script in <when green flag clicked> than just those codes on ur forum i need to put
<when green flag clicked>
<go to x sad   )y sad 
<play sound[
<hide>
how could i add those in to your platforming script

You could put them all at the beginning before the forever loop.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#10 2010-02-27 13:45:01

alexdent123
Scratcher
Registered: 2010-01-19
Posts: 8

Re: How do i make a sprite jump?

ty also what if the land is diff colors do i just repeat that part over with diff colors in each slot? also how do i define a variable?

Last edited by alexdent123 (2010-02-27 13:47:18)

Offline

 

#11 2010-02-28 04:13:12

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How do i make a sprite jump?

I put the variables there because it made more sense when reading, you can just make them simple numbers. OR you can make the variables, and define them using the
<set{  }to(

block. And you'd just change the color to the color of the land you're using.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#12 2010-02-28 04:36:23

mariofan231
Scratcher
Registered: 2010-02-28
Posts: 7

Re: How do i make a sprite jump?

GRRR WHY IS MY PLAYER ANIMATING FAST?
I TRIED EVERYTHING
<switch to costume[
<switch to costume[
<switch to costume[
<switch to costume[
<switch to costume[
<move(  )steps>

Offline

 

#13 2010-02-28 05:06:44

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How do i make a sprite jump?

Please don't spam. And for animating, you might want to put a <wait(  )secsc> block between costume blocks.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#14 2010-02-28 08:53:47

alexdent123
Scratcher
Registered: 2010-01-19
Posts: 8

Re: How do i make a sprite jump?

how do i make my guy stand on like a platform for one part he has to jump up on platforms but they dont do anything and he can't stand on them how do i resolve this?

Offline

 

#15 2010-02-28 10:40:55

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: How do i make a sprite jump?

I know three ways to make a sprite jump.

1. The N00B way:

http://i47.tinypic.com/34sjt49.gif

2. The Beginner Way:

http://i48.tinypic.com/29x9aa9.gif

3. The Advanced Way:

http://i50.tinypic.com/257iqnm.gif

I strongly suggest The Advanced Way. But, it may be hard to understand, it still works.



mariofan231 wrote:

GRRR WHY IS MY PLAYER ANIMATING FAST?
I TRIED EVERYTHING

<switch to costume[
<switch to costume[
<switch to costume[
<switch to costume[
<switch to costume[
<move(  )steps>

Why don't you try putting the [wait ( ) secs] block in-between the [switch to costume [ ] ]



alexdent123 wrote:

how do i make my guy stand on like a platform for one part he has to jump up on platforms but they dont do anything and he can't stand on them how do i resolve this?

Are they moving platforms? If not, make sure they are the same sprite as the ground sprite. If they are not the same sprite, make sure that the player is "in-air" color coded, and the platforms are the same color as the original ground. If they ARE moving platforms, then I do not know how to help.

Hope it helps!  smile

       ~Henley

Last edited by henley (2010-02-28 10:49:42)


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#16 2010-02-28 13:09:43

alexdent123
Scratcher
Registered: 2010-01-19
Posts: 8

Re: How do i make a sprite jump?

they're not sprites should i make them sprites?

Offline

 

#17 2010-03-01 07:01:33

Dazachi
Retired Community Moderator
Registered: 2009-09-12
Posts: 1000+

Re: How do i make a sprite jump?

alexdent123 wrote:

they're not sprites should i make them sprites?

Well you need sprites to put the scripts in.


Dazachi, Retired Community Moderator
May also know me as OJACheung.

Offline

 

Board footer