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
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)
Offline
can u use the up arrow instead of space key?
Offline
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
Here's a guide, there's a part about making a basic platformer. http://scratch.mit.edu/forums/viewtopic.php?id=30916
Offline
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
@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 )y
<play sound[
<hide>
how could i add those in to your platforming script
Offline
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 )y
<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.
Offline
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
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.
Offline
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
Please don't spam. And for animating, you might want to put a <wait( )secsc> block between costume blocks.
Offline
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
I know three ways to make a sprite jump.
1. The N00B way:
2. The Beginner Way:
3. The Advanced Way:
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!
~Henley
Last edited by henley (2010-02-28 10:49:42)
Offline
they're not sprites should i make them sprites?
Offline