Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » how do i make a sprite jump??
- jpegs
-
11 posts
how do i make a sprite jump??
hey!!
so, my friend and i are working on trying to create a platformer. we've got the left and right controls nailed down, and we can travel through levels. however, i don't know how to make the sprite go up and be able to freely move left and right while in the air as it descends back onto the ground. the way we have it right now, the sprite just rises up, hangs suspended into the air for a few seconds, and then falls.
http://imgur.com/a/B9tdw
the way it's behaving makes sense, (the “wait” part freezes the sprite) but we have absolutely no idea how to fix it/make it do what we want. we've even looked into the code for multiple other platformers and games with similar controls here on scratch, and all we see is variables that are named “jump” or something similar, and key sensing blocks that only change the costume? (the costume change doesn't seem to activate anything), and it's hard to make sense of the jumble of code. how do we achieve this affect? i sound like a test problem lolol
so, my friend and i are working on trying to create a platformer. we've got the left and right controls nailed down, and we can travel through levels. however, i don't know how to make the sprite go up and be able to freely move left and right while in the air as it descends back onto the ground. the way we have it right now, the sprite just rises up, hangs suspended into the air for a few seconds, and then falls.
http://imgur.com/a/B9tdw
the way it's behaving makes sense, (the “wait” part freezes the sprite) but we have absolutely no idea how to fix it/make it do what we want. we've even looked into the code for multiple other platformers and games with similar controls here on scratch, and all we see is variables that are named “jump” or something similar, and key sensing blocks that only change the costume? (the costume change doesn't seem to activate anything), and it's hard to make sense of the jumble of code. how do we achieve this affect? i sound like a test problem lolol
Last edited by jpegs (Oct. 21, 2016 18:02:23)
- -frostyiceprincess-
-
1000+ posts
how do i make a sprite jump??
I don't really know how to explain it, but check out some platformer tutorials out there that will teach you.
- Austinato
-
1000+ posts
how do i make a sprite jump??
This may be seen as advertising, but I find it accurate. Feel free to look over the sprites found in this project, but please give credit as well.
Thanks for reading,
Austinato
Thanks for reading,
Austinato
- WolfCat67
-
1000+ posts
how do i make a sprite jump??
A simple “Gravity” function for jumping is as follows:
This Scratch block mess took me forever to draw, and this is the first time I've ever attempted to make the Jump programming so compact. This might be the easiest way to do it, but this line of coding hasn't been tested yet. Tell me if this works or not, and make sure to edit the “Set Y to —”s to whatever you want. The special thing about this programming is that it doesn't use Custom Blocks and will also allow you to go up through the platform, but will land on the platform while falling back down. This is a more compact version of all of the programming I used for “PixelCube Platformer”, my platformer that you can find a link to inside of my signature if you'd like.
Last edited by WolfCat67 (Oct. 22, 2016 18:04:44)
- jpegs
-
11 posts
how do i make a sprite jump??
are there any tutorials in particular that'd u'd reccommend? I don't really know how to explain it, but check out some platformer tutorials out there that will teach you.
A simple “Gravity” function for jumping is as follows:This Scratch block mess took me forever to draw, and this is the first time I've ever attempted to make the Jump programming so compact. This might be the easiest way to do it, but this line of coding hasn't been tested yet. Tell me if this works or not, and make sure to edit the “Set Y to —”s to whatever you want. The special thing about this programming is that it doesn't use Custom Blocks and will also allow you to go up through the platform, but will land on the platform while falling back down. This is a more compact version of all of the programming I used for “PixelCube Platformer”, my platformer that you can find a link to inside of my signature if you'd like.
hey, thanks a bunch!! i just tried it out, and unfortunately, it didnt work, (the sprite started rising and didn't stop until it went as high as it could go…) but putting this together helped me understand how it worked, to some extent. again, thank you! we really appreciate it!!
Last edited by jpegs (Oct. 26, 2016 17:07:46)
- glados10
-
69 posts
how do i make a sprite jump??
I can't give you the exact scripting on this idea, but if you want to do a really basic jump for a sprite, you could use the glide function and make it glide up. You could use the “when space key pressed” block and attach a “change y by _” block to it. This will make the sprite go upwards when you press space, stimulating a jump. I hope this was helpful, and good luck on your platformer!
- WolfCat67
-
1000+ posts
how do i make a sprite jump??
Hey, jpegs, just remember that you should probably post questions like this inside of the “Help with Scripts” section of the forum instead of the “Questions About Scratch” forum. You'd get better results there, as that's where all the experts tend to be.
- Shreyankgowda1
-
2 posts
how do i make a sprite jump??
are there any tutorials in particular that'd u'd reccommend? I don't really know how to explain it, but check out some platformer tutorials out there that will teach you.A simple “Gravity” function for jumping is as follows:This Scratch block mess took me forever to draw, and this is the first time I've ever attempted to make the Jump programming so compact. This might be the easiest way to do it, but this line of coding hasn't been tested yet. Tell me if this works or not, and make sure to edit the “Set Y to —”s to whatever you want. The special thing about this programming is that it doesn't use Custom Blocks and will also allow you to go up through the platform, but will land on the platform while falling back down. This is a more compact version of all of the programming I used for “PixelCube Platformer”, my platformer that you can find a link to inside of my signature if you'd like.
hey, thanks a bunch!! i just tried it out, and unfortunately, it didnt work, (the sprite started rising and didn't stop until it went as high as it could go…) but putting this together helped me understand how it worked, to some extent. again, thank you! we really appreciate it!!







- Discussion Forums
- » Questions about Scratch
-
» how do i make a sprite jump??