A tip for Platformer Developers!

Posted by (twitter: @ToastedGames)
April 3rd, 2016 3:26 pm

Platformers have been a fairly difficult genre for beginner programmers to design. Most of the problems I’ve encountered come from the physics engine that has to be built. Generally, people don’t know how to program collisions with tilesĀ and end up with players hovering over the ground, falling through the ground, or some other equally annoying glitch. I want to show you how to issues like this, with a script I made. Well, I won’t give you the exact script, because you won’t be using the same program as me, but here’s the basics:


(make 'i' equal 'velocity', if 'i' is greater than 0, repeat this loop until it equals 0, subtracting 1 every time)

//Run the script below for every pixel the player would move.
{
if there's an object at 'x', 'y'+'i' and it's a platform,
subtract 1 from 'velocity' //Lower how far down to go.
}
'y' = 'y' + 'velocity' //Go to the new velocity.

Well, that’s all for now. Hope this helps! Bye :)

(This post was a snip from my post on the Toasted Games website. Here’s the full post.)
-Ben

Tags: , , , , ,


Leave a Reply

You must be logged in to post a comment.

[cache: storing page]