Platform Games

A platform game or platformer is a side-scrolling 2D game where the main game play element is gravity. This sets up the game play to revolve around jumping from one platform to the next.

Basic Concepts

Platform Game Tutorial for Beginners
Everything you need to start make a simple platform game with Game Maker is included in the Official Platform Game Tutorial which you can download on this page at the official YoYo Games website.

Platform

A platform is anything the player object can stand on.

Setting Up Gravity

All objects in platform game such as the player object and enemies are affected by gravity — but only if they are in the air. If so, the gravity is set so that they can fall. Checking for platforms can be accomplished with place_free().

// check if in air, step event
if(place_free(x,y+1))
{
    gravity = 0.5; // turn on the gravity
}

While falling, the vspeed needs to be limited to keep objects from falling too fast.

//step event

if (vspeed >= 12)
{
    vspeed = 12;
}

When an object collides with a platform, it needs to be set back to it's previous position last step, moved to contact with the platform, and vspeed and gravity set to 0.

// in collision event with platform

move_contact_solid(direction, 12);
vspeed = 0;
gravity = 0;

Jumping

Jumping Too Low / High?

The lower you set the vspeed the higher an object will jump. (-7 is lower than -4, remember, we're using negative numbers here.)

  • If the object is jumping too high, increase the number.
  • If the object is jumping too low, decrease the number.

A character can be made to jump by setting the vspeed to a negative number. This simulates the physics of pushing off the ground to cause the force necessary to overcome gravity. Before this is done, you should first check to make sure that the character is on a platform and therefore has something to push against :

if (keyboard_check_pressed(vk_space) and place_free(x,y+1))
{
    vspeed = -4;
}

If you have set up an object with the "gravity code" above, then gravity will naturally overcome the "force" of the jump and make the character come back down.

Double Jump

A double jump is a jump that the player can attempt while falling from the first jump.
The code isn't really that complex but if you need help go here Double_Jump

Crouching

Moving Slower While Crouching

Platform Shooter

A platform shooter is a type of action game that is also a platform game.

Enemies

There are many different kinds of platform game enemies with platform walkers, platform guards. pouncers and wavers being the most common.

Themes

Token Collecting

Non-action platform games are notoriously known for token-collecting. In the Mario series of games, it's coins. In the Sonic series it's rings. The current writer supposes that this is to give the player something to do as there is nothing to shoot.

Some Platform Games

Related Pages

Backlinks

These pages link back to this page. You may find them useful.

Links

Game Design Network

Web

Categories: Platform Games : Video Game Genres