Lots of people are asking how to make a simple platformer, so here it is;
Chapters
GRAVITY
SCROLLING
Gravity
Method 1:
Make a sprite called "Ground".
Now give the main sprite this script;
You will notice that your sprite will now seem to have a gravitational pull.
Method 2:
Make another sprite called "sensor". It should be about the width of your main sprite.
Give your sensor these scripts;
I used change y by -55 because that way the sprite would just be touching the ground. It does not always have to be y -55.
If you think that your sprite is falling to fast or too slow, increase or decrease the number in the "change y by []" block, respectively.
Scrolling
Scrolling is harder; it includes longer scripts.
This is a compact method;
Make two sprites that are background size. Name them background1 and background2.
Give background1 this script:
Give background2 this script:
And give the stage this script:
Last edited by JeanTheFox (2010-08-07 18:07:21)
Offline
Thanks for posting this tutorial. Glad to have something to point people to when they ask for platforming help. Could you consider adding a section for scrolling, since they are often used in conjunction?
Offline
I don't get the sensor xP. And for the gravity, put 3 if's inside of each other and make it change y by 1 each if. That makes it do the same thing as your gravity, but it detects to the pixel.
Offline
Sunrise-Moon wrote:
I don't get the sensor xP. And for the gravity, put 3 if's inside of each other and make it change y by 1 each if. That makes it do the same thing as your gravity, but it detects to the pixel.
Should I use that as another method?
Sunrise-Moon wrote:
Thanks for posting this tutorial. Glad to have something to point people to when they ask for platforming help. Could you consider adding a section for scrolling, since they are often used in conjunction?
I'll try
Offline
Harakou wrote:
Thanks for posting this tutorial. Glad to have something to point people to when they ask for platforming help. Could you consider adding a section for scrolling, since they are often used in conjunction?
Done!
Offline
(Epic) Bump!
Offline