Sure!
Platformers are actually really easy to make, once you get the concept. I actually never knew how to and I eventually figured out. The main thing in a platformer is scrolling, i will explain that to you and more if you would like:
So the scrolling in a platformer is basically just 2+ images the size of the entire screen that seem as if they are connected. To make them scroll along side each other, you need to know the full length of the screen which is 480 in scratch. Now you know the length, how will they go side by side? Well, when you create a sprite the size of the screen, the x position will be set to 0. So the Sprite covers the screen at x 0. We will set the x position of the first image to be 0. The second image needs to be to the right of that image, so it will be the x position of image 1 + 480. The third image will be the x position of image 1 + 480 * 2 and so on. That is all there is to it! So to actually put this in work and test it:
1) Make a variable called ScrollX, this will be to move the images back and forth in the screen
2) Make three sprites that fill up the screen, maybe three colors (Red, Blue, and Black)
3) Create this script for the first image you choose, I chose red:
When Flag Clicked
Forever
Set X Position to ScrollX
end
4) Okay, make this for the next image, I chose Blue
When Flag Clicked
Forever
Set X Position to ScrollX + 480
end
5) Now make this for the final image, I chose Black
When Flag Clicked
Forever
Set X Position to ScrollX + (480 * 2)
end
6) Now make a script to control the movement of the three screens.
When Left Key Pressed
Change ScrollX by 3
end
When Right Key Pressed
Change ScrollX by -3
end
Okay, those are the basics. (Sorry I just got back on scratch, I dont know how to use scratch blocks.) Test it out! It works right? In a platformer, you would replace the color images with separate backgrounds. If you wanted to loop back when you reach the end of the third image, you just have to reset the scroll x. Thats all! Everything else is pretty easy. The character actually stays in the same position, the only changes he makes depends on the type of platformer. If you would like more, just ask! Here is a platformer i made: http://scratch.mit.edu/projects/itsmomito/1120339
Offline
Not all platformers use the scrolling method. Some of the best I've seen stay on the x,y grid and don't try to make it bigger. To make a platformer, everybody likes realistic gravity like found here. For arrow key movement look at this forum. For jumping look here. And if you still don't know what to do, check out a scripting tutorial index found here.
Offline
itsmomito wrote:
Sure!
Platformers are actually really easy to make, once you get the concept. I actually never knew how to and I eventually figured out. The main thing in a platformer is scrolling, i will explain that to you and more if you would like:
So the scrolling in a platformer is basically just 2+ images the size of the entire screen that seem as if they are connected. To make them scroll along side each other, you need to know the full length of the screen which is 480 in scratch. Now you know the length, how will they go side by side? Well, when you create a sprite the size of the screen, the x position will be set to 0. So the Sprite covers the screen at x 0. We will set the x position of the first image to be 0. The second image needs to be to the right of that image, so it will be the x position of image 1 + 480. The third image will be the x position of image 1 + 480 * 2 and so on. That is all there is to it! So to actually put this in work and test it:
1) Make a variable called ScrollX, this will be to move the images back and forth in the screen
2) Make three sprites that fill up the screen, maybe three colors (Red, Blue, and Black)
3) Create this script for the first image you choose, I chose red:when gf clicked forever set x to (ScrollX) end4) Okay, make this for the next image, I chose Bluewhen gf clicked forever set x to <(ScrollX) + [480]> end5) Now make this for the final image, I chose Blackwhen gf clicked forever set x to <(ScrollX) + <[480] * [2]>> end6) Now make a script to control the movement of the three screens.when gf clicked if <(left v) key pressed?> change (ScrollX) by [3] endwhen gf clicked if <(right v) key pressed?> change (ScrollX) by [3] endOkay, those are the basics. (Sorry I just got back on scratch, I dont know how to use scratch blocks.) Test it out! It works right? In a platformer, you would replace the color images with separate backgrounds. If you wanted to loop back when you reach the end of the third image, you just have to reset the scroll x. Thats all! Everything else is pretty easy. The character actually stays in the same position, the only changes he makes depends on the type of platformer. If you would like more, just ask! Here is a platformer i made: http://scratch.mit.edu/projects/itsmomito/1120339
Fixed it a bit!
Last edited by joletole (2012-03-15 21:20:51)
Offline
joletole wrote:
itsmomito wrote:
Sure!
Platformers are actually really easy to make, once you get the concept. I actually never knew how to and I eventually figured out. The main thing in a platformer is scrolling, i will explain that to you and more if you would like:
So the scrolling in a platformer is basically just 2+ images the size of the entire screen that seem as if they are connected. To make them scroll along side each other, you need to know the full length of the screen which is 480 in scratch. Now you know the length, how will they go side by side? Well, when you create a sprite the size of the screen, the x position will be set to 0. So the Sprite covers the screen at x 0. We will set the x position of the first image to be 0. The second image needs to be to the right of that image, so it will be the x position of image 1 + 480. The third image will be the x position of image 1 + 480 * 2 and so on. That is all there is to it! So to actually put this in work and test it:
1) Make a variable called ScrollX, this will be to move the images back and forth in the screen
2) Make three sprites that fill up the screen, maybe three colors (Red, Blue, and Black)
3) Create this script for the first image you choose, I chose red:when gf clicked forever set x to (ScrollX) end4) Okay, make this for the next image, I chose Bluewhen gf clicked forever set x to <(ScrollX) + [480]> end5) Now make this for the final image, I chose Blackwhen gf clicked forever set x to <(ScrollX) + <[480] * [2]>> end6) Now make a script to control the movement of the three screens.when gf clicked if <(left v) key pressed?> change (ScrollX) by [3] endwhen gf clicked if <(right v) key pressed?> change (ScrollX) by [3] endOkay, those are the basics. (Sorry I just got back on scratch, I dont know how to use scratch blocks.) Test it out! It works right? In a platformer, you would replace the color images with separate backgrounds. If you wanted to loop back when you reach the end of the third image, you just have to reset the scroll x. Thats all! Everything else is pretty easy. The character actually stays in the same position, the only changes he makes depends on the type of platformer. If you would like more, just ask! Here is a platformer i made: http://scratch.mit.edu/projects/itsmomito/1120339Fixed it a bit!
Thanks a lot!
Offline
itsmomito wrote:
joletole wrote:
itsmomito wrote:
Sure!
Platformers are actually really easy to make, once you get the concept. I actually never knew how to and I eventually figured out. The main thing in a platformer is scrolling, i will explain that to you and more if you would like:
So the scrolling in a platformer is basically just 2+ images the size of the entire screen that seem as if they are connected. To make them scroll along side each other, you need to know the full length of the screen which is 480 in scratch. Now you know the length, how will they go side by side? Well, when you create a sprite the size of the screen, the x position will be set to 0. So the Sprite covers the screen at x 0. We will set the x position of the first image to be 0. The second image needs to be to the right of that image, so it will be the x position of image 1 + 480. The third image will be the x position of image 1 + 480 * 2 and so on. That is all there is to it! So to actually put this in work and test it:
1) Make a variable called ScrollX, this will be to move the images back and forth in the screen
2) Make three sprites that fill up the screen, maybe three colors (Red, Blue, and Black)
3) Create this script for the first image you choose, I chose red:when gf clicked forever set x to (ScrollX) end4) Okay, make this for the next image, I chose Bluewhen gf clicked forever set x to <(ScrollX) + [480]> end5) Now make this for the final image, I chose Blackwhen gf clicked forever set x to <(ScrollX) + <[480] * [2]>> end6) Now make a script to control the movement of the three screens.when gf clicked if <(left v) key pressed?> change (ScrollX) by [3] endwhen gf clicked if <(right v) key pressed?> change (ScrollX) by [3] endOkay, those are the basics. (Sorry I just got back on scratch, I dont know how to use scratch blocks.) Test it out! It works right? In a platformer, you would replace the color images with separate backgrounds. If you wanted to loop back when you reach the end of the third image, you just have to reset the scroll x. Thats all! Everything else is pretty easy. The character actually stays in the same position, the only changes he makes depends on the type of platformer. If you would like more, just ask! Here is a platformer i made: http://scratch.mit.edu/projects/itsmomito/1120339Fixed it a bit!
Thanks a lot!
actually I need help on sensing the ground.
Offline
For the ground sprites
when gf clicked forever if <not<<jumping?>=[1]>> if <touching [player v]?> set [touching player? v] to [1] end if <not<touching [player v]>> set [touching player? v] to [0] endThe "touching player?" is a variable
when gf clicked forever if <not<<jumping?>=[1]>> if <<touching player?>=[0]> change [Gravity v] by [-0.1] end if <<touching player?>=[1]> set [Gravity v] to [0.01] end change y by <Gravity>"Gravity" to make it simulate actual gravity, it will be bouncing a little bit.
when gf clicked forever if <key [up arrow key v] pressed?> set [jumping? v] to [1] set [Gravity v] to [10] repeat until <<touching ground?>=[1]> set [Gravity v] to <<Gravity>*[0.98] change y by <Gravity> end endIf there's anything wrong with the scripts please fix it. I have never actually put gravity into my game.
Last edited by MaxFlyboy (2012-03-16 19:07:16)
Offline