Discuss Scratch

TaylorSwftie13
Scratcher
1 post

How can i make a sprite be able to jump and land on to another platform?

I want to know how to make a sprite jump and land on another platform. I also want to know how to walk on a platform (another sprite) without going through it. I just joined scratch and I am just learning the basics. Thanks! (P.S if you could give me the script that would be even more helpful)
MicroMacro
Scratcher
100+ posts

How can i make a sprite be able to jump and land on to another platform?

Make the sprite detect if it is touching the platform. If the velocity is positive, let it pass through the platform. If negative or equal to zero, stop the sprite.
Gamenzo
Scratcher
27 posts

How can i make a sprite be able to jump and land on to another platform?

TaylorSwftie13 wrote:

I want to know how to make a sprite jump and land on another platform. I also want to know how to walk on a platform (another sprite) without going through it. I just joined scratch and I am just learning the basics. Thanks! (P.S if you could give me the script that would be even more helpful)

go to: http://scratch.mit.edu/projects/42179122/
Cyoce
Scratcher
500+ posts

How can i make a sprite be able to jump and land on to another platform?

Here ya go. I definitely over-commented it, so feel free to only look at the comments for parts that don’t make sense to you. Also, I apologize if the comments sound patronizing; that’s just how my comments turn out when I’m explaining, not documenting.

when gf clicked
set [fall v] to [0] //this is how fast the character is currently falling
set rotation style [left-right v] //makes the player face the right direction
forever
change y by (fall) //this moves the character according to how fast they're falling
if <touching [platform v]?> then //oh no! this last step pushed him into a wall! let's reverse it!
change y by ((0)-(fall)) //moves him the same amount in the opposite direction, reversing the move
if <key [up arrow v] pressed?> then //player is telling the character to jump
set [fall v] to [10] //jumping makes you move upwards faster!
else //the player wants to land, not jump
set [fall v] to [0] //stop his fall
end
else //he is not touching the ground—airborne!
change [fall v] by (-1) //since he is not on the ground, gravity makes him fall faster
end
if <key [left arrow v] pressed?> then //player wants to move left
point in direction (-90 v) //face left
move (10) steps //move left
if <touching [platform v]?> then //he hit a wall!
move (-10) steps //go back
end
end
if <key [right arrow v] pressed?> then //player wants to move right
point in direction (90 v) //face right
move (10) steps //right left
if <touching [platform v]?> then //he hit a wall again! (clumsy one, isn’t he?)
move (-10) steps //go back
end
end
end
Cyoce
Scratcher
500+ posts

How can i make a sprite be able to jump and land on to another platform?

MicroMacro wrote:

Make the sprite detect if it is touching the platform. If the velocity is positive, let it pass through the platform. If negative or equal to zero, stop the sprite.
This would not always work. That is the correct basic principle, but here is the catch: if the jump were to peak while the player is still in the platform, then the player would get stuck. You would need a variable to keep track of what state the velocity was in when first entering the platform. Also, this would screw up the side-side hit detection.
Massivecool7
Scratcher
6 posts

How can i make a sprite be able to jump and land on to another platform?

this is to long
dementedfrog
Scratcher
2 posts

How can i make a sprite be able to jump and land on to another platform?

thanks cyoce
dementedfrog
Scratcher
2 posts

How can i make a sprite be able to jump and land on to another platform?

thnx soooo much
teammate43
New Scratcher
1 post

How can i make a sprite be able to jump and land on to another platform?

This one made my sprite move upward instead of downward
griffles2
Scratcher
1 post

How can i make a sprite be able to jump and land on to another platform?

how did you get the platform sense? i cant find it trying to make a game and need to now how to get the platform sense. thx.
deck26
Scratcher
1000+ posts

How can i make a sprite be able to jump and land on to another platform?

griffles2 wrote:

how did you get the platform sense? i cant find it trying to make a game and need to now how to get the platform sense. thx.
I suggest you start your own topic if you want help.
tacoknight
Scratcher
7 posts

How can i make a sprite be able to jump and land on to another platform?

Wow I will totally add Cyoce to the credits in my next platformer.
0_oMAYAo_0
New Scratcher
2 posts

How can i make a sprite be able to jump and land on to another platform?

same with griffles2
cs237439
Scratcher
2 posts

How can i make a sprite be able to jump and land on to another platform?

I never tried it because it is to long we just want to land on something!
tuckerhayes24
Scratcher
4 posts

How can i make a sprite be able to jump and land on to another platform?

teammate43 wrote:

This one made my sprite move upward instead of downward
Yeah
aidanmonkey07
Scratcher
7 posts

How can i make a sprite be able to jump and land on to another platform?

sorry
when green flag clicked
forever

if <touching [platform v] ?> then
go to [aaaaaaaaaaaaaaaaaaaammmmyyyy v]
end

end
hitsboo920
Scratcher
54 posts

How can i make a sprite be able to jump and land on to another platform?

I know how to play fruit ninja
maverick_raven12
Scratcher
100+ posts

How can i make a sprite be able to jump and land on to another platform?

try
when [up arrow] key pressed
jump
end

define jump
repeat ()
change y by ()
if <touching color ()> then
repeat (distance from ground sprite)
change y by ()

Last edited by maverick_raven12 (April 7, 2016 00:47:22)

manoslol
Scratcher
40 posts

How can i make a sprite be able to jump and land on to another platform?

TaylorSwftie13 wrote:

I want to know how to make a sprite jump and land on another platform. I also want to know how to walk on a platform (another sprite) without going through it. I just joined scratch and I am just learning the basics. Thanks! (P.S if you could give me the script that would be even more helpful)
Let me help you .Give me the project and I have a ready awsome sprite!
ZiNzC
Scratcher
39 posts

How can i make a sprite be able to jump and land on to another platform?

https://scratch.mit.edu/projects/104731346/

look at the cripts i used in that gane. Hope it will help you

Powered by DjangoBB