Game

GameMaker: Studio 1.4 – Platformer Tutorial



The most effective way to make a robust platform game in just 40 lines of code. All explained line by line.

Follow me on twitch.tv for livestreamed game development and more!

Pledge any amount monthly to me on Patreon:
and support free tutorial content for everybody.

Download the project files!

Find more tutorials at:

I believe in accessible education, this video’s content and any included GameMaker source files are and always will be free for anyone to use in their projects, commercial or otherwise. No credit or consent is needed to use this code in your own work, I merely ask that the video and/or source files themselves are not redistributed as they are without my consent.

Nguồn: https://jacarandarmfm.com/

Xem thêm bài viết khác: https://jacarandarmfm.com/game/

42 Comments
  1. neongamer 1344 9 months ago
    Reply

    I wanna do a game where you build up speed anyone know how to do that with gms1's html code?

  2. Bozidar Savic 9 months ago
    Reply

    u re good at programming but bad at teaching it

  3. Olly Rofl 9 months ago
    Reply

    I was stuck for one hour because I added an extra e to the jumpspeed variable …

  4. Pedro Henrique Baretta 9 months ago
    Reply

    The room speed is 60, but on my project with the room speed of 30, the game is kinda slow, any idea on how to speed up the platform system without having to change the room speed? I'm trying to mess around with the variables without sucess.

  5. Containment Lunan45 9 months ago
    Reply

    Changed comment lol.
    Anyways, this works REALLY WELL, EVEN IN 2020! I got gamemaker studio in June 2019 and this still works really well!
    I wanted to make a platformer game so I can come out as lesbian to my dad (Because it's educational for me and I guess it's fun for him), so I got worried that I couldn't make one.
    But then I gave this a try and I was, god I was so fricking happy THANK YOU.

  6. H1Z018 9 months ago
    Reply

    Holy Shit, i fucking love you

  7. El Agente guisante 007 :v 9 months ago
    Reply

    love ya'

  8. EinMeister 9 months ago
    Reply

    I can't jump D:

  9. PapiNito 9 months ago
    Reply

    So ive tried to create a separate object named obj_door and used the same code to act as a wall. ive written the exact same code down except using obj_door instead of obj_wall. though whenever i run the game the enemies and player falls through the door like quicksand. Please help!

  10. Team m bomb 9 months ago
    Reply

    There's a small glitch where when the player falls they get stuck in the ground and you have to jump to get free. Anyone know how to fix that?

  11. ScreamingGameDev 9 months ago
    Reply

    14:42

  12. Elvis Ente 9 months ago
    Reply

    I tried this 1 year ago, i was frustrated because even if i followed it step by step, didn't work.
    Then i made a game (very advanced, it hast it's music, character, enemies, textures, some music…) taking a few liberties and creating a "checkpoint system", but the code was a disaster.

    Now i follow the platformer tutorial and notice about something: the only error i had is the room speed, i didn't change it. Now i'm laughing at myself.

    Thanks, Spalding.

  13. Theodore Shiloah 9 months ago
    Reply

    Great tutorial! I was also wondering how I can add my sound effect when the player jumps?

  14. Leonid Jovanovski 9 months ago
    Reply

    This is probably one of the best game maker tutorials, thanks for the help!

  15. The legendary Quagsire 9 months ago
    Reply

    how do i add more floor/wall types

  16. DinoLaris 9 months ago
    Reply

    i've got a problem. i did everything but i keep getting stuck in the floor and im forced to jump out.

  17. UltimateKyato45 9 months ago
    Reply

    There's a problem when you tried to jump and landed on the corner of a block.

    i guess i have to make a new collision for both X and Y. same process and combine the two and youll be ok

  18. Kate Jaraba 9 months ago
    Reply

    thank you~ this really helped me making my school works!

  19. George Washington 9 months ago
    Reply

    I built a game in demo, and know have a licensed account. How do I transfer that game for android?

  20. Kavya Agarwal 9 months ago
    Reply

    This game can work in lite version? By the way the game is very good

  21. cristian llamas 9 months ago
    Reply

    Dude, Shaun is making this waaaaay to complicated, so much so that I could not understand what to do by the 20 minute mark

  22. Operationgamer17 9 months ago
    Reply

    Okay, something’s going on. I followed this tutorial exactly as it was in the video, but when I click “Run” like he did at 16:54, the splash screen appears then I just get a black screen. Help?

  23. Sabby 9 months ago
    Reply

    I don’t want to use code

  24. Scarfy 9 months ago
    Reply

    My character only goes to the right, help?

  25. MEMES COMPILATION 9 months ago
    Reply

    i cant move left

  26. Ferrariedhgs 9 months ago
    Reply

    I have a weird problem. The character doesn't move if i don't jump before pressing a movement key. What should I do?

  27. Joseph Hamilton 9 months ago
    Reply

    while(!place_meeting(x+sign(hsp),y,obj_wall))
    ^
    Every instance of the code: obj_wall)) was not lit in the red and the game suggested it an error.
    It is super simple and i had the code written exactly as he had it.
    I rewrote it like 3 time, the page
    and the obj_wall like 20 some off times and i didnt work

    Only until i imported his code to check mine did it work, why?

  28. Genius Pheonix123 9 months ago
    Reply

    Anyone know why the collision code refuses to work in a top-down game environment even with the same base for the movement code

  29. yum lo 9 months ago
    Reply

    17:28

  30. Marko Kraljik 9 months ago
    Reply

    //get the players input
    keyboard_right = keyboard_check(vk_right);
    key_left = -keyboard_check(vk_left);
    key_jump = keyboard_check_pressed(vk_space);

    //React to inputs
    move = key_left + key_right;
    hsp = move * movespeed;
    if (vsp < 10) vsp +=grav;

    if (place_meeting(x,y+1,obj_wall))
    {
    vsp = key_jump * -jumpspeed
    }

    x += hsp;
    y += vsp;

  31. yiğit efe animasyon 9 months ago
    Reply

    //Get the player 's input

    key_right = keyboard_check(vk_right);

    key_left = -keyboard_check(vk_left);

    key_jump = keyboard_check_pressed(vk_space);

    //React to inputs

    move = key_left + key_right;

    hsp = move * movespeed;

    if (vsp < 10) vsp += grav;

    if (place_meeting(x,y+1,obj_wall))

    {

    vsp = key_jump * -jumpspeed

    }

    //Horizontal Collision

    if (place_meeting(x+hsp,y,obj_wall))

    {

    while(!place_meeting(x+sign(hsp),y,obj_wall))

    {

    x += sign(hsp);

    }

    hsp = 0;

    }

    x += hsp;

    //Vertical Collision

    if (place_meeting(x+vsp,y,obj_wall))

    {

    while(!place_meeting(x+sign(vsp),y,obj_wall))

    {

    x += sign(vsp);

    }

    vsp = 0;

    }

    y += vsp;

  32. DroidM4Ever 365 9 months ago
    Reply

    At 16:47 I copied that code line for line. It seems to be working great, but when I try to move left, it goes right. It goes right if I press right too. Any way to fix this?
    EDIT: I forgot the – on the key_left

  33. Robin Hall 9 months ago
    Reply

    great tutorial however my when I incorporate a sprite it jumps from position to position. Not sure why

  34. Aides 9 months ago
    Reply

    Thank you

  35. Andreas Müller 9 months ago
    Reply

    Incredibly useful, thanks a lot!

  36. Vapor Neon 9 months ago
    Reply

    Hey! Someone on wikihow made a article that uses your code from this video, but doesn't explain it correctly and also includes code from other things all mashed together in a way that doesn't work.

  37. HandiApp 9 months ago
    Reply

    This shit doesnt work. 1st my player doesnt jump, second if I click Left it goes right, like what??

  38. Goofy Mahoofy 9 months ago
    Reply

    earned my fucking subscription with this

  39. Kojirou Kamei 9 months ago
    Reply

    Exactly what I was looking for! Thank you.

  40. Nzzertral 9 months ago
    Reply

    i followed the code EXACTLY the way it is on the video but when i test it out the player can ONLY GO RIGHT, i don't know what i did wrong

    ///get player input and collision
    key_right = keyboard_check(vk_right);
    key_left = keyboard_check(vk_left);
    key_jump = keyboard_check_pressed(vk_space);

    //player inputs
    move = key_left + key_right;
    hsp = move * movespeed;
    if (vsp < 10) vsp += grav;

    if place_meeting(x,y+1,obj_wall){
    vsp = key_jump * -jumpspeed
    }

    //horizontal collision
    if place_meeting(x+hsp,y,obj_wall){
    while(!place_meeting(x+sign(hsp),y,obj_wall)){
    x += sign(hsp);
    }
    hsp = 0;
    }

    //horizontal collision
    if place_meeting(x+hsp,y,obj_wall){
    while(!place_meeting(x+sign(hsp),y,obj_wall)){
    x += sign(hsp);
    }
    hsp = 0;
    }
    x += hsp;
    //verticle collision
    if place_meeting(x,y+vsp,obj_wall){
    while(!place_meeting(x,y+sign(vsp),obj_wall)){
    y += sign(vsp);
    }
    vsp = 0;
    }
    y += vsp;

  41. Jack Moorin 9 months ago
    Reply

    Why do you need the while loops inside the collision checks? I've got it working fine without them, just setting the movespeeds to 0

  42. GuzzDoritos 9 months ago
    Reply

    so the reason for the while statement in the if statement is for making perfect collisions? I made this question 'cause i tried to erase the while statement and it still working correctly, but the collision now is not that perfect. (Sorry for the english. I'm a brazillian and i still learning)

Leave a Comment

Your email address will not be published.

You may also like