# How to make a platformer like a pro

Hello, we are gonna make a platformer.

So we start.

1. Get a character and a tile block

2. In the character’s code, make a variable. Put [Set (X) to ((self) X position)]
And do the same with the y so it looks like

Also as you see, do
[when game is playing
[Set position to (x) (y)]
Step 2. Make new vars called x speed and y speed. Put in code [Increase (x) by (x speed) and Increase (y) by (y speed)

And do increase (y speed) by (-1)

The character is all done. We will move onto the tiles. I start with the collision but it is too hard to go through with you.
So I start with making a clone by doing [when game starts] repea

Now, we make a clone for how many objects. Take a custom rule purple block thing and name it, [Level Data]. Inside it, I put what will happen to the clone, not what happens to it. For me, I put repeat times (fhfbvb) create a clone. Now when I go to level data. I make it so that when object is cloned and the clone index it (5) then set a new variable called [block] to 5. Or the index number of your clone.

Then, make a new custom rule block called tile data. If my clone index is 3, I put here,

When block=3
[Set position x (bleh) y (bleh]
[Set width (bleh) height (bleh)]
[Set (collision)* = 1]

*this comes in the collisions code.

And you’re done. You do this for all of the clones you have or want. And you get a platformer!

Here is an example and where to get your collisions code
18 Likes

Very nice topic!

2 Likes

Oh wait I forgot to do the controls

3 Likes

1 Like

Make the controld
Ok for the controls, put this in the right controls.

[When (ur right button) is pressed]
[Increase (x speed )(yes the one from the character)by 1]
[end]
Also
[When game is playing]
[set (x speed) to ((x speed) divided by (1.1)
[end]

For left, put
[when (self) is pressed]
[increase (x speed) by (-1) ]
[end]

4 Likes

This topic was automatically opened after 5 minutes.

Bookmarks

2 Likes

This does not work

2 Likes

2 Likes

What do you mean, bleh?

2 Likes

Here bleh means ‘something’

Nice tutorial:)

1 Like

Hey, is there anything wrong, I can fix it.

2 Likes

Brilliant, I have been thinking about making platformers for a while now, but I’ve never known how to code it, thank you very, very much.

2 Likes
###### Let’s bookmark this 🤨🙂
2 Likes

I’ll make a platformer out of this

Yeah the controls and the copy collisions they aren’t urs

1 Like

Since when did I say it was mine

1 Like

I think you should put the collision code in it

1 Like