Make a Platform Game in Game Maker

This will require a little bit of experience with Game Maker. Don't do this for your first game.

Steps

  1. Make a simple block sprite for your wall. Also make a sprite for your player. For the wall call it spr_wall and the player spr_player
  2. Make an object called obj_wall and check the solid box.
  3. Make sure you select the wall sprite.
  4. Make an object and call it obj_player.
  5. Make sure you select your player sprite.
  6. For obj_player: go to add event and click Step then Step again. Then go to the control tab, and drag and drop the 'execute code' action.
  7. Now in the code box put in
    // simple Platforming code!//
    if place_free(x,y+1)
    {
    gravity = 0.7
    gravity_direction = 270
    }
    else
    {
    gravity=0
    gravity_direction = 270
    }
    //the arrow keys<,>,^
    if place_free(x-4,y)and keyboard_check(vk_left){x-=4}
    if place_free(x+4,y)and keyboard_check(vk_right){x+=4}
    if !place_free(x,y+1)
    and keyboard_check(vk_up){vspeed=-10}
  8. Just copy and paste.
  9. For obj_player: Go to add event, then Collision, then with obj_wall.
  10. Put in this code (go to the control tab and drag and drop 'execute code':

    move_contact_solid(direction,12);
    vspeed=0;
  11. Make a room, call it room_1, make a level design by clicking with the selected object and save the room (click the tick at the top.)
  12. Run the game!



Things You'll Need

  • GameMaker of course! This tutorial uses GM:S Professional, but Standard is also good. You'll also need a bit of experience in GML first before doing this tutorial.

Related Articles

  • Create an FPS Creator Game
  • Get Started With Game Maker
  • Transfer Game Maker 7.0 from One Computer to Another
  • Create a Game Like Club Penguin in Game Maker 8