GameMaker Studio 2: Complete Platformer Tutorial (Part 1: Basics)

Поделиться
HTML-код
  • Опубликовано: 1 фев 2025

Комментарии • 3,6 тыс.

  • @SaraSpalding
    @SaraSpalding  2 года назад +191

    If the collision system in this video no longer works for you, you might need to enable "collision compatibility mode" in Game Options -> Main Options -> General. GameMaker has changed over the years!
    Alternatively, I have released a new 5 minute video that covers all of these basics and is up to date with 2022+ standards: ruclips.net/video/ywgkXbHYJNE/видео.html

    • @sunshinefeon
      @sunshinefeon 2 года назад +2

      I cant find collision compatibility any where. Tried looking up global setting but I couldn't find anything. Can you tell me where this setting is located?

    • @SaraSpalding
      @SaraSpalding  2 года назад +5

      @@sunshinefeon global game settings, main options, general. At the bottom of the page. This is assuming you're using a very recent version of GameMaker.

    • @SaraSpalding
      @SaraSpalding  2 года назад +7

      Noticing now they've changed the IDE and the menu is now called simply "Game Options", represented by the little cogwheel icon on the top bar.

    • @sunshinefeon
      @sunshinefeon 2 года назад

      @@SaraSpalding Ah, ty.

    • @SUBtoMasonman101
      @SUBtoMasonman101 2 года назад +5

      When ever the player falls it gets stuck do you know how to fix that?

  • @TheHouseton
    @TheHouseton 4 года назад +494

    Create Sprites (Player/Wall) - 0:48
    Create Objects (Player/Wall) - 2:53
    Room Explanation - 3:45
    Placing Objects in Room - 4:19
    Event coding:
    Explanation - 6:26
    oPlayer Create Event Coding - 7:03
    Variable Explanation - 8:17
    oPlayer Step Event Explanation - 11:28
    Step Event Coding (Movement) - 12:50
    Step Event Coding (Local Variable explain) - 15:00
    Step Event Coding (Movement contd) - 17:08
    Game Options FPS setting - 19:15
    Step Event Coding (Collisions Section) - 20:11
    Comment/Description Explanation - 20:52
    Step Event Coding (H Collision code start) -21:40
    Step Event Coding (V Collision code start) - 27:11
    Step Event Coding (V Movement) - 28:56
    Step Event Coding (Jumping) - 29:44
    (Bonus) - 32:05
    if mouse_check_button(mb_middle)
    {
    search_gm2_manual(function currently highlighted);
    }

    • @lasy5159
      @lasy5159 3 года назад +2

      Hey man could you help me
      So my problem is when i put the walls on the same instance as the player in my case a boat is, the walls dont prevent the boat from going through them.
      thanks so much for helping me.
      Heres my script
      // Keybind wasd vk_comands
      keyboard_set_map(ord("W"), vk_up);
      keyboard_set_map(ord("A"), vk_left);
      keyboard_set_map(ord("S"), vk_down);
      keyboard_set_map(ord("D"), vk_right);
      // vk up
      if (keyboard_check(vk_up)) y= y-2;
      // Get player Input
      key_up = keyboard_check(vk_up);
      key_left = keyboard_check(vk_left);
      key_right = keyboard_check(vk_right);
      // calculate movement
      var move = key_right - key_left;
      hsp = move * walk_sp;
      // horizontal collision
      if (place_meeting(y+hsp,y,Owall))
      {
      while (!place_meeting(x+sign(hsp),y,Owall))
      {
      x = x + sign(hsp);
      }
      hsp = 0;
      }
      x = x + hsp;
      i have // vk up because i wanted to move verticaly the keybinds are here for so i can use w a s and d.
      So my problem is when i put the walls on the same instance as the player in my case a boat is, the walls dont prevent the boat from going through them.
      thanks so much for helping me.

    • @dotmbarricade3424
      @dotmbarricade3424 3 года назад

      Thx man

    • @athletica5571
      @athletica5571 3 года назад

      Wow Ur cool

    • @theairacobra
      @theairacobra 3 года назад

      @@lasy5159 while (!place_meeting(x+sign(hsp),y,Owall))
      you put a mayus in o, when it should be oWall

    • @eros.2634
      @eros.2634 3 года назад

      King

  • @toolongdidntstudy8838
    @toolongdidntstudy8838 7 лет назад +686

    I remember 3 years ago I went to learn GameMaker Studio, and Shaun's platformer tutorial was there for me to learn. Now I can produce a platformer on the spot without any references.
    I'm delighted to see that you're producing a tutorial for the people getting into GM:S 2.
    Thanks Shaun.

    • @donkyer
      @donkyer 7 лет назад +15

      Too Long; Didn't Study
      Can relate, mate, he gets an 8/8.
      (sorry couldn't resist)
      Seriously though,
      Shaun helped me start programming, which led me to get into advanced programming(OO)
      The amount of stuff I learnt on this channel is alot.
      Just checking in to help these people with their errors.

    • @evilerroryt8448
      @evilerroryt8448 7 лет назад +1

      I'm gonna subscribe I'm new to gamemaker studio 2. My friend and I want to make very awesome games for fun and maybe for a bit if cash but mostly for fun I can't wait for more content like this :)

    • @jakob6455
      @jakob6455 7 лет назад

      Hi,
      I have a problem with loading my game...
      it takes me 30 seconds. Do you maybe know what is wrong? The computer is very fast.
      Thank you for great tutorials.

    • @tthomas-mj1iy
      @tthomas-mj1iy 7 лет назад

      Yeah loved his gm tutorials and now im happy to see he did some for gm2 to

    • @nickbrickslegoanimations1042
      @nickbrickslegoanimations1042 6 лет назад

      is Game Maker Studio still available or is it out of service now?

  • @blakeburgers22
    @blakeburgers22 Год назад +58

    This was SOOO helpful! I’m 14 years old and I’ve been wanting to code my own video game for a while now, moving on to part two! (I’m hopeful! 🤞)

    • @milokochili
      @milokochili Год назад +1

      Same here, it has been so useful and only has been the first part

    • @laxels8835
      @laxels8835 Год назад +1

      same also

    • @SecretarySquare
      @SecretarySquare Год назад +1

      yup

    • @patopeje1472
      @patopeje1472 Год назад +1

      man... I meet gamemaker at my 14, and I didn't understand a sh*t because in that time there wasn't RUclips tutorials, and I didn't understand english pretty well
      you are so lucky lol

    • @blakeburgers22
      @blakeburgers22 Год назад +1

      @@patopeje1472 lol! Fr

  • @josephloos5044
    @josephloos5044 6 лет назад +324

    I can now make a cube move in a very limited space. And it only took me literally from about 3pm to 12am. Feelin proud.

  • @dkipaz3117
    @dkipaz3117 6 лет назад +1751

    Anybody who wants to add A = left and D = right (like the WASD controls) just do this:
    key_left = keyboard_check(ord("A"));
    key_right = keyboard_check(ord("D"));

    • @g1ues
      @g1ues 6 лет назад +26

      thanks bro!

    • @poatatosalad6349
      @poatatosalad6349 5 лет назад +16

      thanks i was looking on how to do it

    • @maxmarohn581
      @maxmarohn581 5 лет назад +6

      i thought it had to be ord('A'), but that was giving me troubles

    • @pat9986
      @pat9986 5 лет назад +18

      From someone who's arrow keys are stupidly tiny compared to the normal WASD, thank you.

    • @Scrufflord
      @Scrufflord 5 лет назад +15

      Thank you! I always thought arrow controls were a little wonky. (Maybe I could add both? Who knows what the preference of the person that plays my game will be?)

  • @frostee5554
    @frostee5554 3 года назад +9

    im new to GameMaker, I've had a decent amount of coding experience back in high school but I have long since forgotten. You are a god send. you are a wonderful teacher, and great to listen to. thank you for all you do and please, keep doing it!

  • @sunhouhua
    @sunhouhua 5 лет назад +405

    Pressing F4 in the code editor lets you add if statements, blocks, etc.
    You're welcome

    • @MatthewN07
      @MatthewN07 4 года назад +2

      Thats actually very useful as I am a beginer! Thanks!

    • @lightstareight6950
      @lightstareight6950 4 года назад

      ty

    • @QBelly
      @QBelly 4 года назад +81

      ALT + F4 opens a secret passage to Narnia.

    • @395leandro
      @395leandro 4 года назад +12

      Delete System(x64) to remove lag.

    • @lightstareight6950
      @lightstareight6950 4 года назад +6

      install hackintosh to get 2 fps

  • @marianateixeira9251
    @marianateixeira9251 4 года назад +21

    I don't often write comments on videos, but I feel obligated to thank you for an amazing set of tutorials with good start. I'm excited to be able to code my first game, as I've only worked as an artist in video-games.

  • @maudesaur
    @maudesaur Год назад +5

    This was so well explained, not only did I enjoy it, but I also verbally made noises in awe of how simple it actually is. THANK YOU.

  • @dang1854
    @dang1854 5 лет назад +220

    This was AWESOME! I had a couple glitches as I went. My mistakes helped me learn stuff:
    1. If you're seeing boxes to drag instead of a place to type in the Create tab as shown in the video, right click and select Switch to GML.
    2. I had a typo in one of my variables in the Create tab. I had walkvp instead of walksp! Also, WALKSP is not the same as walksp - capitalization DOES count.
    3. I had semicolons at the end of my if and while statements. Don't put semicolons there.
    4. I put a semicolon instead of a comma in one of the x,y+1,o_wall statements.
    Excellent, nay, PERFECT video for a first timer.

    • @volk4342
      @volk4342 4 года назад +3

      ty

    • @Baleur
      @Baleur 4 года назад +3

      Well its better to think of it this way, dont put semicolons when a { follows after it.

    • @aydemironur35
      @aydemironur35 4 года назад

      lol ty i was searching where im doing the mistake :D

    • @findtheshuaibs3888
      @findtheshuaibs3888 3 года назад +4

      I can't get past this part for some reason, my player just automatically goes left all the time and i cant bring it to the right
      Edit: fixed it, i wrote x = x * hsp; which was why it wasn't working

    • @jacosazul
      @jacosazul 3 года назад +1

      ty

  • @moellersworkshop2116
    @moellersworkshop2116 5 лет назад +6

    I've been writing platform games since 85' while in high school using 6502 on an Apple IIe, what I've learned in this life is that the most important thing an artist can do (that is what we all are) is to master the rudiments, before we can construct the fantastic. I really enjoyed getting this man's perspective on "elegant logic" for good object control in a platform game construct. You "experts" are encouraged to just go over this step by step and you may be surprised at a perspective you didn't have on some very elemental, but critical components of game making. Thanks again Shaun.

  • @TinyDragonGamer250
    @TinyDragonGamer250 2 года назад +10

    You are the first person to explain the actual meaning and purpose of each bit of code. You my sir/mam have earned my respect.

  • @andrewchariker1246
    @andrewchariker1246 5 лет назад +79

    [SOLUTION]
    If your player is "floating" and stays in the air too long, then you need to raise your grv variable. At 29:03, Shaun changes the value from 0.1 to 0.3. He does it really fast and might be hard to catch. Good luck with your game!

  • @jase1976
    @jase1976 6 лет назад +44

    Thanks you, this is great. I was struggling with other tutorials to understand the code, but I understood most of this and feel I'm making progress for the first time with all this making games stuff. I'm looking forward to continuing.

    • @chappie3642
      @chappie3642 6 лет назад

      Hi, how has it been going?
      As someone who began 2 years ago I hope I Can help

    • @timschuchner
      @timschuchner 5 лет назад

      @@chappie3642 I am curious as well how you are both doing since I just started with gms this month.

    • @chappie3642
      @chappie3642 5 лет назад

      @@timschuchner I don't code with GSM, I know Java and C++, I usually use my own engine

    • @falingo
      @falingo Год назад

      how is your progress

  • @jaded9436
    @jaded9436 3 года назад +192

    I'm really interested and following along. But it feels like my brain is going to explode at the same time. These videos are super helpful.

    • @CommanderHof
      @CommanderHof 3 года назад +4

      yooo same

    • @RickyTheRoster
      @RickyTheRoster 3 года назад +1

      Bro which version is this when i download it from Google when i open it it always say it stopped working what to do

    • @Innocentzz
      @Innocentzz 2 года назад

      same

  • @jaydawn8704
    @jaydawn8704 7 лет назад +128

    Although my vision for what I want to make isn't a platformer, this was an awesome intro and I'm a little upset I'm so early to the series because I want to spend a day just working through these tutorials! It's like when you start watching a show during it's initial air vs when the series is complete, the wait is awful lol.

    • @manwhodoesthings
      @manwhodoesthings 6 лет назад +1

      i can't even get pass the vertical coding part. lol.

    • @OnBrandRP
      @OnBrandRP 6 лет назад +7

      Just a tip for any future game developers, when you get stuck like this, duplicate your project then start experimenting. or have other smaller projects to work on.

    • @uanamenezes7689
      @uanamenezes7689 Год назад

      @@OnBrandRP thank you for the tip

  • @rupertdenton1
    @rupertdenton1 6 лет назад +10

    This is my first ever comment on RUclips I think. But I just wanted to say thank you for taking the time to make these videos. It is extremely helpful for a beginner.

  • @shared-knowledge
    @shared-knowledge 4 года назад +9

    as a programmer my self (php/java/X++) i would like to say that this tutorial was a great example of how to do tutorials the right way

  • @leodacosta1
    @leodacosta1 5 лет назад +242

    This video made coding fun for me. So much so that I made it wall jump!
    //Wall Jump
    if (place_meeting(x+hsp,y,oWall)) && (key_jump)
    {
    vsp = -7;
    }
    Thanks!!! You are an awesome teacher :D

    • @hole1274
      @hole1274 3 года назад +9

      for anyone looking to copy this, you might also add momentum away from the wall
      hsp = -sign(hsp) * 2;
      and if you're doing it after the collision (which makes sense) hsp will be 0, so save sign(hsp) in the collision and set the walljump's place meeting to (x+hSignVariable,y,oWall)

    • @captaincharlie1044
      @captaincharlie1044 3 года назад +4

      @@hole1274 excuse me, could you rewrite the code the original poster posted? your description of what to do isnt making a lot of sense, sry im a beginner

    • @hole1274
      @hole1274 3 года назад +13

      @@captaincharlie1044 I found a better way since then
      //check for a wall in the direction you're pointing
      if (place_meeting(x+move,y,oWall)) && (key_jump)
      {
      vsp = -7;
      hsp = -3 * move; //move away from the direction you're pointing
      }

    • @captaincharlie1044
      @captaincharlie1044 3 года назад

      @@hole1274 youre a lifesaver!! Thank you!

    • @captaincharlie1044
      @captaincharlie1044 3 года назад +1

      @@hole1274 alright, sorry for keeping this going, but the wall jump works! however, i dont want the player to be able to just keep on wall jumping up the same wall over and over. i want them to kind of bounce away from the wall naturally after one walljump. would you know how to do this? if its easier(and if you have discord) my discord username is EdgeGod27 #3004

  • @IBACAU123
    @IBACAU123 6 лет назад +28

    Wow!
    I've watched my first 8 minutes and i've gotten more done than any other tutorial!
    You can sure explain stuff and i'm looking forward to more and more content from you!

  • @PleasantWhale
    @PleasantWhale 4 года назад +2

    7:03 For anyone who got worried when you clicked, "create" but no space to code appeared, don't worry. Just go to the Events Tab, right click Create to open a drop-down menu, and select, "Convert to GML." Or it'll say something similar to that. Then boom, you'll have the same screen this guy does.
    10:18 Also, it's at this point when it clicked, "Oh, I see why people like dark theme. My eyes aren't bleeding right now." First time I've used dark theme in a game editing tool.
    16:40 Oh I get it, and that is very clever Mr. Spalding~.
    Finally, I want to say thanks a ton man! You explained everything very plainly and simply. Looking forward to the rest of your tutorials!

    • @scythegin9473
      @scythegin9473 4 года назад +1

      THANK YOU SO MUCH CUZ AT 7:03 I WAS SO CONFUSED AND IM LIKE OMG WHAT AM I SUPPOSED TO DO WTH

    • @PleasantWhale
      @PleasantWhale 4 года назад

      @@scythegin9473 heheh, no prob~.

    • @PleasantWhale
      @PleasantWhale 4 года назад

      @GAMEFREAKS No prob bob.

  • @lunasoldev
    @lunasoldev 4 года назад +661

    Instructions unclear ended up with a 4D shooter with a battle royale mode

  • @Etcher
    @Etcher 5 лет назад +5

    Excellent work Shaun, thank you! Love this series. I come back to the later episodes regularly to remind myself about certain techniques as I need to implement them. Thanks again.

  • @hrp127
    @hrp127 Год назад +1

    Thanks, that was incredibly helpful. I spent hours reading manual but it's always easier when someone explains and shows you that. Thank you again!

  • @RobotKitsune
    @RobotKitsune 5 лет назад +17

    Just tried this tutorial out--and I had a lot of fun with it! It's so satisfying to see the code at work. Thank you for the great lesson!

  • @zaynebmoin9917
    @zaynebmoin9917 5 лет назад +73

    use f8 and f9 keys to zoom in and out in event code
    I'm pretty sure this is useful!

    • @PandaFishification
      @PandaFishification 5 лет назад +2

      Thank You!!

    • @jenniferg224
      @jenniferg224 4 года назад +8

      uh, on my computer its f7 and f8.. not trying to be rude but just letting people know in the replies if they have any issues ;D

    • @ichifish
      @ichifish 4 года назад

      Wish I'd looked down here before I googled it! Thannks!

  • @ignskeletons
    @ignskeletons 4 года назад +9

    Just an incredible tutorial series, you've given so much to us through your content and I appreciate it a bunch :)
    Just resubscribed to your Patreon!

  • @lunasoldev
    @lunasoldev 4 года назад +90

    If you want to add sprinting to the game you just need to put:
    key_sprint = keyboard_check(vk_shift);
    to the key section
    and add:
    if(key_sprint)
    {
    hsp *= 1.75;
    }
    in front of:
    x = x + hsp;

    • @NIKOSPARAPONIARIS
      @NIKOSPARAPONIARIS 4 года назад +2

      It Works! But (after adding this feature after the next tut) there is an issue.. stacking on walls .. i guess its a collision problem!

    • @zzzxggg_al
      @zzzxggg_al 4 года назад +1

      Nikos Paraponiaris yes I’ve met a similar situation, it seems to be sticking around the closed angles, may need additional code to get it run smoother

    • @FulsomeFrog
      @FulsomeFrog 2 года назад

      I can't seem to get this to work, idk why maybe its just different versions of gms2 broke stuff or im being dumb and messing up things somehow

  • @persianshayan3700
    @persianshayan3700 5 лет назад +390

    First game making Tutorial i watched until the end. I enjoyed it && learn alot. So...
    {
    I subscribed
    }

    • @falilivud6937
      @falilivud6937 5 лет назад +12

      Are you acting like code *||* are you just getting insane by codes

    • @ohmai1290
      @ohmai1290 5 лет назад +14

      you just forget the semicolon at the end, lol

    • @legsofjelly4428
      @legsofjelly4428 5 лет назад +20

      if (likes_video == true)
      {
      subscribe = true;
      }

    • @Snailsxd
      @Snailsxd 5 лет назад +6

      @@legsofjelly4428 you don't need to check if it's true, if you just put in the value it'll check for you

    • @nokutokamomiji
      @nokutokamomiji 5 лет назад +5

      Radio oHmAi Actually, GML (The language used in GameMaker Studio 2) doesn’t require the use of semicolons.

  • @mlindquist8942
    @mlindquist8942 4 месяца назад

    oh my goodness, I am so close to finishing my first game and I have gone back to these tutorials probably 300+ times hehe, I have heard the first split second of this countless times and will probably hear more of it in the future, thank you so so much for these tutorials!

  • @t-boneproductions6779
    @t-boneproductions6779 5 лет назад +4

    You're very smart. I'm barely grasping key points here. Thank you for the video. I'm using my android for a fps creator, and so far the video has been very helpful. Thank you man.

  • @reda827
    @reda827 6 месяцев назад

    I know almost nothing about game making or programming but I found your video very good and simple to follow. You really show everything step by step. I'll hopefully continue and finish your series.

  • @yanisel3477
    @yanisel3477 4 года назад +55

    Game Maker Studio is like a mix of unreal engine of blueprint and C++ with an actual good 2d implementation

  • @kinklez
    @kinklez 6 лет назад +4

    I like the speed he goes at. Just gets straight to the steps, no fillers!

  • @roccccat
    @roccccat 3 года назад +1

    After 4 years still the best GM S 2 Platformer Tutorial on YT.

  • @rockzom
    @rockzom 7 лет назад +51

    Thanks, Shaun! Wonderful stuff.

  • @GodOfTetris90
    @GodOfTetris90 6 лет назад +7

    Thanks Shaun for this amazing tuto. i allways try to implement a liitle more so i can learn. I did double jump and it work perfect. keep it up

  • @stuartholt6278
    @stuartholt6278 3 года назад

    Dude, thank you.
    I have had game maker stuido for months, I'd opened it a couple of times and read a few documents on it but everytime I'd been overwhelmed by it and gave up.
    I came across one of your other intro videos the other day, and made a note to come back. Just sat down today, and in what 40 minutes I have done more than I have achived in months!

  • @jona7164
    @jona7164 5 лет назад +7

    This Tutorial was so helpful, thank you.
    At the first moment I thought Game Maker were not a Script language like Scratch and after I saw that it's a script language I thought, that I will never can do something with Gama Maker, but you explained everything so good that I think I understood more than I some Scratch Tutorials.

  • @pablo_p_art
    @pablo_p_art 3 года назад +3

    As a completely noob in coding, I found it useful and now starting to understanding it! Many thanks!

  • @MagicTurtle643
    @MagicTurtle643 2 дня назад

    Incredible. Thank you so much for this. I know how to code virtual pinball tables but I'm dying to learn to make normal games. This was hard to grasp but it does make sense. I'm gonna work through all your videos and give it my best shot. Thank you for making them!!!

  • @illdie314
    @illdie314 7 лет назад +483

    19:27 "you can leave it at 30 if you prefer"
    but you shouldn't prefer

    • @henryw4535
      @henryw4535 7 лет назад +25

      Yep, it looks very slow and choppy in 30fps.

    • @Luka-sf3vu
      @Luka-sf3vu 7 лет назад +1

      xd

    • @randumbcrits6125
      @randumbcrits6125 6 лет назад +8

      CiNeMaTiC 30 fPs

    • @aurorajarvis5502
      @aurorajarvis5502 6 лет назад +3

      a lot of games work even better at higher frame rates than your monitor can push out. Dont believe me? if you're playing counter-strike with a locked frame-rate try taking it off. This isn't something that's discussed all that often because of the power needed to push a game beyond 200 fps. playing a game at 80fps or whatever just means screen tearing

    • @wyzolol
      @wyzolol 6 лет назад

      lol

  • @dormin100
    @dormin100 7 лет назад +307

    [[ SOLUTION ]]
    Lots of guys having a problem where the player just falls into the ground and become incapable of moving, i had the same problem and found some unanswred comments asking for help..
    i latter found that the IF statment on the vertical collision part had "y+sign(vsp)" written rather than 'y+vsp", wich is the correct way...
    im proud as a begginer to have discovered the logical problem by myself, although i shoudn't had comited it in the first place hahaa

    • @pedroinogueiras
      @pedroinogueiras 7 лет назад +3

      Thanks, you are a true god.

    • @masonclark702
      @masonclark702 7 лет назад

      this didnt work for me is there any other fix as ive been looking for weeks with no luck thanks

    • @dormin100
      @dormin100 7 лет назад +2

      Mason Clark be sure to check the collision masks and the origin points as they can also produce some weird bugs

    • @jessedamon2825
      @jessedamon2825 6 лет назад +1

      Why did this work? This solution worked for me but I don’t understand why becquse the videos code had the (x,y+sign(vsp),oWall)

    • @dormin100
      @dormin100 6 лет назад +3

      Jesse Damon if you set the collision to check on y+sign(vsp), it will be true everytime the collision mask is exactly one pixel above the ground, and will send you to the same place again and again and again

  • @shaneaudette6763
    @shaneaudette6763 3 года назад

    I took programming 20 years ago. Haven't touched it since, looking to dabble in gamemaker. Your video is bringing it all back and your explanations are VERY clear. Thank you

  • @gamemastery4227
    @gamemastery4227 4 года назад +6

    I was actually happy when in the end player was moving and jumping around :D

  • @SkeleTomm
    @SkeleTomm Год назад +7

    It's possible to experience a game freeze using this method of movement/collision if you character falls onto the corner of a block at certain angles. From what I remember, this is because the collision wasn't set up for diagonal collision, so to avoid the issue, add this below your horizontal and vertical collision
    //Diagonal Collision
    if (place_meeting(x+hsp,y+vsp,oWall))
    {
    while (!place_meeting(x+sign(hsp),y+sign(vsp),oWall))
    {
    x += sign(hsp);
    y += sign(vsp);

    }
    hsp = 0;
    vsp = 0;
    }

    • @voidymite
      @voidymite Год назад +1

      W, thanks

    • @susniynarezchik
      @susniynarezchik Год назад +1

      This is really nice, its working and good for basic platformer, but if you need to build up momentum in your game, this code actually might kill it.

    • @SkeleTomm
      @SkeleTomm Год назад +1

      @@susniynarezchik I haven't had any issues using acceleration and this code so far, as all the code is for is to stop you from getting frozen in a while loop when you land on a corner at a near perfect 45 degree angle, which is pretty much the only time the code seems to fire

    • @SkeleTomm
      @SkeleTomm Год назад +1

      @@susniynarezchik On second thought I have had some issues with losing momentum. Do you have a more elegant solution?

    • @susniynarezchik
      @susniynarezchik Год назад +1

      ​@@SkeleTomm Yooooo i didnt think you would adress my comment that fast! As i said, your code works perfectly fine without need of any momentum implementation, but in my case it didnt work out. So, for example, i tried saving data of hsp to some momentum_saver variable right before the jump (i had set different accel/decel for it), but right before the variables data gets saved, it changes to 0. First of all, i tried saving hsp data at a different place, but I couldnt get it accurate enough. For now, i basically did a simple pre-hmove check, and turned hsp to 0 if future collision detected (also i needed that bc my character goes way too fast for game to control), and before that i save my momentum data. it turned out smth like that:
      //Horisontal collision
      if (place_meeting(x+hsp, y, oPlatform) ){
      while (!place_meeting(x+sign(hsp),y,oPlatform)){
      x = x + sign(hsp);
      momentum_save = hsp;
      }
      hsp = 0;
      }
      //momentum save (post collision check)
      if (place_meeting(x - hsp, y - vsp, oPlatform) and state_c == "running"){
      momentum_saver = hsp;
      }
      //Pre horizontal move check
      if (place_meeting(x+hsp,y,oSpikes) or place_meeting(x+hsp,y,oPlatform))
      {
      hsp = 0;
      }
      x = x + hsp;
      Yeah, as u get it, i am new to gm, and i very appreciate your help to us, newbies. I guess i might find more elegant solution later, but it is what it is right now. (And yeah lol, sorry for any potential grammar mistakes i made here, since english isnt my first language.) Anyways, wishing you best of luck!

  • @bahamutaxiomx8706
    @bahamutaxiomx8706 Год назад

    I'm new to coding, and new to your channel. I must say, what a beautiful tutorial you've created. The best I've seen yet. Very comprehensive and VERY easy to follow; the easiest I've seen yet.
    I've got a pretty bad anxiety when it comes to watching tutorials since school, but the smoothness and thoroughness of your tutorial is perfect for allowing me to follow along!
    Thank You! Looking forward to more in the future!

  • @jedidiah2686
    @jedidiah2686 7 лет назад +4

    I am very new to GML. I have been using the drag and drop in gm:1 for a few years so it nice to learn GML. As a challenge I tried to add triple jumping without any tuts and I finally did it. You just have to add a var called airj and set it to 0 in the create event. Then add airj = 0; to the check for wall on y, then add if (!place_meeting(x,y+1,obj_wall)) && (key_jump) && (airj < 2) {
    vsp = -7;
    airj = airj + 1;
    }
    to the bottom of the code.

    • @XO-cq6gx
      @XO-cq6gx 6 лет назад

      Hey! I have a question, I can only double jump 1 time, how do I make it unlimited

    • @Isakube
      @Isakube 5 лет назад

      @@XO-cq6gx use drag n drop lol. i tried it and you can jump unlimited times without adding the y+1 thing

  • @purementalgames1605
    @purementalgames1605 4 года назад

    Truly appreciate this series, Shaun. Just posting to highlight something. I had some glitching as I continued to play around with this code; on line 11 you are adjusting the vertical speed by gravity, but not first checking if the object (here the player, later also enemies) is on the ground. As a result, a vertical collision is being detected on every step, although it looks ok because ultimately vsp is reset to zero in the section that handles the vertical collision. Can be fixed by replacing line 11 with :
    if (!place_meeting(x,y+1,oWall)) vsp = vsp + grv;
    Not trying to nit-pick, just posting in case this helps anybody else with their own variations based on this code. Cheers.

  • @hildanateghi778
    @hildanateghi778 7 лет назад +82

    mine does not have a ''typing bar'' i cant type in the codes when creating events, heeeelp :))))

    • @freya4333
      @freya4333 7 лет назад +79

      Right click on the empty space (left of the tool box) and click 'Convert to GML'

    • @LunaRiddle77
      @LunaRiddle77 7 лет назад +10

      Freya Marshall Woooo thank you, I had the same problem and I was starting to think I did something wrong :0

    • @hildanateghi778
      @hildanateghi778 7 лет назад +4

      thank you soooooo much!

    • @100Jim
      @100Jim 7 лет назад +1

      Thanks worked for me!

    • @scorpio7536
      @scorpio7536 6 лет назад +1

      omg thx man

  • @acasualplayer4778
    @acasualplayer4778 3 года назад +3

    Thank you a bunch for this, I made my own game and I'm so happy!

  • @fierzy_new
    @fierzy_new 2 года назад

    I’ve only watched up to 16:25 and this video is great at explaining and this series will help make my platform game, it’s a great tutorial.

  • @matisseeeee
    @matisseeeee 4 года назад +17

    I was having a problem where my player would just fall through the ground
    I fixed it by :
    1. Going to the player sprite in the workspace tab and expanding collision mask (left hand side)
    2. setting mode to "manual"
    3. looking at the sprite preview window and clicking and dragging a black box over the entire sprite
    I think the reason I got this error is that I changed the origin of the object ( in the video somewhere around 2:03) to top left instead of center but i'm not sure.

    • @bioshockgril
      @bioshockgril 4 года назад

      i was having an issue where it wasnt stopping on the right side, i did what you suggested and now it's not moving at all lmao.

    • @Thomas-yq5yl
      @Thomas-yq5yl 4 года назад

      Hey man/miss
      I've been coding for a bit and working with stuff like this and yet I thought my code was F***ed. Bouta start again and then I checked the comments. You saved me. Hats of to good sir.

    • @simon3123
      @simon3123 4 года назад

      after 2 days of struggeling i foud your comment, i tried it and it worked!
      thanks man

    • @MachineMan64
      @MachineMan64 4 года назад

      After doing this I still have the green box fall through the ground, it'll still stop at the sides of the walls, but it still falls through. Need help :(

    • @pagina_1316
      @pagina_1316 3 года назад

      I had the same problem but i just deleted the while command in the vertical collision.

  • @peterwu5957
    @peterwu5957 5 лет назад +10

    Hello,everyone,I'm Peter Wu,come from China.Todey is my first day at RUclips. Nice to meet you,and I'm very happy to study gms2 with you. 😂

    • @FranckOlive
      @FranckOlive 4 года назад

      thats actually very cute

  • @caojedap
    @caojedap 4 года назад

    Hey Shaun, i'm on my 30's SQL Python VBA Programmer over here.
    I've always wanted to try making my first vg, and you are the first guy that actually make it easy to understand!
    Just wanted to thanks!

  • @kevo9429
    @kevo9429 6 лет назад +13

    vsp = vsp + grv makes me unable to move my obj, what to do ?

    • @onecanvanbam6775
      @onecanvanbam6775 5 лет назад

      I had a similar issue and it was that I'd left a hsp in where we copy and paste it for vertical collision, check there maybe?

  • @qrowbranwen
    @qrowbranwen 6 лет назад +35

    5:01 me when I try to make a straight line with a mouse

  • @CashSaucee
    @CashSaucee Год назад

    you've gotten me back into coding after years, thank you! I'm looking forward to watching the rest of this series!!

  • @super-creative-stuff1421
    @super-creative-stuff1421 5 лет назад +4

    The collision code works great but there is one problem with it. Since it doesn't check the space in-between the character's current position and their future position, if they're moving fast enough, their future position will be past the object they should have collided with and they'll appear to phase through it. To be fair my improved code is a little long winded so if you know this will never be an issue in your game, then The original code might be better suited:
    *also I'm using xDist instead of hsp and yDist instead of vsp
    //I'm keeping sprite_width-height in abs incase the sprite has been mirrored
    //x(horizontal)
    //segScan is how many collision boxes fit in the distance to be traveled not including fractions of the collision box
    segScan = 0;
    if (abs(xDist) > abs(sprite_width)){
    segScan = floor(abs(xDist) / abs(sprite_width));
    }
    //loop through all of the segscan intervals
    for (i = 0; i

    • @iwillgotokoreawhenigrowup8155
      @iwillgotokoreawhenigrowup8155 5 лет назад +5

      super-creative-stuff BRO THANKS FOR YOU HARD WORK BUT IM SO NOT GONNA TRY IT CUZ ITS TOO LONG AND SCARY

    • @TheRealModiK
      @TheRealModiK Год назад

      @@iwillgotokoreawhenigrowup8155 I feel you so much rn

  • @AtlasInTheWest
    @AtlasInTheWest 6 лет назад +12

    I’m immediately running into an issue, I’ve copied down exactly the coding you used and yet my character will not move when I press the left and right buttons

    • @princessmossy6930
      @princessmossy6930 6 лет назад +5

      I know this is three months old but I found the solution to this for anyone who was wondering like I was. What I did was in the map placed the sprites into the room. You need to place the OBJECTS into the room. The sprites are just pictures they aren't the objects with the coding. Replace the sprites with objects and this should work!

    • @AtlasInTheWest
      @AtlasInTheWest 6 лет назад +1

      Princess Mossy I actually figured that out myself a few days after I commented this, but thanks!

    • @tithatario3915
      @tithatario3915 6 лет назад

      @@princessmossy6930 not working for me. I used an object. No movement :(

    • @isaacsachs4244
      @isaacsachs4244 6 лет назад

      @@tithatario3915 I have the same problem. Did you end up figuring it out?

    • @lucamateipintilie7006
      @lucamateipintilie7006 6 лет назад

      Contact Parkour
      This is a very bad idea, but I don’t want to bother with tech support so try to use drag and drop mode and use the tutorials from the official website of the devs. Basically there are blocks that do the typing for you. Like a puzzle. Good luck.
      Plus it might be an update that broke it. I’ll try another time

  • @baconman113
    @baconman113 4 года назад +2

    Great tutorial. I realize this tutorial is aimed at complete beginners, but I still found it very useful as a professional software engineer. Goes to show how talented an educator you are.
    I've participated in a few game jams over the years with Unity and Unreal; however, I've found that I really have to fight those engines to get my games to do the things I want. I'm looking into Game Maker because of its simplicity and ease of use when creating 2D games. A lot of experienced game devs look down on this engine because of its simplicity; however, I think the fact that it is so simple and easy-to-use goes to show how well designed a tool it is. You can tell the team that built this engine put a lot of thought into the UX. Was considering making my game from the ground up in Rust, but this tutorial has really sold me on Game Maker. At the end of the day, why re-invent the wheel?

  • @cactus7524
    @cactus7524 7 лет назад +28

    steps script:
    //Get Player Input
    key_left = keyboard_check(vk_left);
    key_right = keyboard_check(vk_right);
    key_jump = keyboard_check_pressed(vk_space);
    //Calculate Movement
    var move = key_right - key_left;
    hsp = move * walksp;
    vsp = vsp + grv;
    if (place_meeting(x,y+1,oWall)) && (key_jump)
    {
    vsp = -7;
    }
    //Horizontal collision
    if (place_meeting(x+hsp,y,oWall))
    {
    while (!place_meeting(x+sign(hsp),y,oWall))
    {
    x = x + sign(hsp);
    }
    hsp = 0;
    }
    x = x + hsp;
    //Vertical Collision
    if (place_meeting(x,y+vsp,oWall))
    {
    while (!place_meeting(x,y+sign(vsp),oWall))
    {
    y = y + sign(vsp);
    }
    vsp = 0;
    }
    y = y + vsp;

    • @iurydantas4787
      @iurydantas4787 7 лет назад

      Thank you! Ive started writing in my notebook but then he put lines between other lines and it all went hell! xD

    • @cactus7524
      @cactus7524 7 лет назад

      XD

    • @iurydantas4787
      @iurydantas4787 7 лет назад

      I think there is a reference problem, make sure that oplayer its written the same on the objects and in the code. Is it really Oplayer with capital O and low p or its like oWall, only the W capital?

    • @hansturbela9514
      @hansturbela9514 7 лет назад

      Cactus ty

    • @gamelsrael
      @gamelsrael 7 лет назад

      Its write to me on vertical and horizontal collision "malformed if statement".
      What to do?

  • @delornegg
    @delornegg Год назад +3

    Any idea why I'm getting an error in the Step event? key_left is underlined with message GM2016 - Instance variable 'key_left' declared outside of Create event, declare with 'var' or move to Create event.
    Everything is setup exactly as demonstrated in the video. Similar errors for key_right and key_jump. I'm also getting a naming convention error for move, it says it should be "_move".

    • @Monster_Face_RB
      @Monster_Face_RB Год назад

      same

    • @therealreishady
      @therealreishady 8 месяцев назад

      they're just suggestions for keeping things tidy, these errors werent made at the time this video came out so they werent considered. as long as your game still launches they aren't anything to stress over (i know this is a very late reply and you probably figured it out but still lol)

  • @its_stel
    @its_stel Год назад

    Amazing tutorial. Even as someone who is not new to programming I enjoyed watching it. Haven't scripted in GameMaker more than this video has shown but from what I gathered adding air jumps was very easy. I just had to create an air jumps variable in "Create" which I would reset at the end of the script if the player was on the ground. Apart from that I changed the jumping function. If the space key was pressed, check if the player is on the ground, if he is then do vsp = -7. Otherwise, if you have air jumps left remove one and change the vsp to something lower (I made mine -4).
    Even though the tutorial was made 6 years ago, it made me want to look into GameMaker even more! Thanks again for explaining the basics!

  • @daniel_1378
    @daniel_1378 6 лет назад +7

    Whenever the player collides with the wall, he gets stuck halfway inside it, and cant move. Someone help pls?

    • @ZiggyStyley
      @ZiggyStyley 4 года назад +2

      check your spelling on some of the code I had an issue like this because I spelt "sign" as "sigh"

    • @jackrenney4122
      @jackrenney4122 3 года назад +2

      @@ZiggyStyley i know this was 5 months ago but thanks for this comment i was banging my head against the wall

    • @ZiggyStyley
      @ZiggyStyley 3 года назад +1

      @@jackrenney4122 the comments on these videos are timeless

  • @raspberry_picker395
    @raspberry_picker395 7 лет назад +55

    Chris Martin is one of your Patreon supporters? Nice.

  • @wierdbob
    @wierdbob 2 года назад

    Wow , this video was a complete delight. When my little cube jumped around the screen I kinda felt like I could do anything. Thanks for making this!

  • @chadcoyle
    @chadcoyle 7 лет назад +22

    I am having a problem when running off a ledge, and immediately running the other direction. I am getting stuck inside the "wall" object by what looks like a single pixel. I tried using round(x) to make sure I am not between pixels but it didn't help.

    • @chadcoyle
      @chadcoyle 7 лет назад +7

      Instead of using my sprite's bounding box, I switched to an even width collision mask sprite for my collisions, and used round(x) for my horizontal movement so I don't end up "between" pixels. This seems to have fixed it.

    • @ClubXXManGame
      @ClubXXManGame 6 лет назад

      Hello. I have the same problem, how to fix it?

    • @followingthetrend_norge2204
      @followingthetrend_norge2204 6 лет назад

      Lol a year later... but i have the same problem

    • @Vaalteq55
      @Vaalteq55 6 лет назад

      @@followingthetrend_norge2204 I think it has something to do with the logic checking for collision. If the player is starts falling at the exact same moment you move back at the wall, the logic correctly detects no wall so movement is allowed. So what happens is the player falls downwards and then because the logic allowed sideways movement it also moves sideways and straight inside the wall

    • @suspiciouswolf933
      @suspiciouswolf933 2 года назад

      im sort of having the same problem but different
      when gravity comes into affect after falling of a ledge (its fine if a jump on the same owall at the same height) i get stuck in one spot a pixel from the owall below and cant move at all, i also can only close the window with the stop playing button instead of the x in the corner
      im having loads of fun with this
      definitely havent been stuck on this problem for hours

  • @fabiochiodi576
    @fabiochiodi576 6 лет назад +8

    Sorry but the sprite does not move and I do not understand why

    • @joyfulnobody
      @joyfulnobody 5 лет назад +1

      @Na Na Then it moves left forever

    • @joyfulnobody
      @joyfulnobody 5 лет назад

      @Na Na Thanks this really helped.

    • @joyfulnobody
      @joyfulnobody 5 лет назад

      @Na Na Yes, I downloaded it last week.

    • @joyfulnobody
      @joyfulnobody 5 лет назад

      @Na Na Thanks!

    • @joyfulnobody
      @joyfulnobody 5 лет назад

      @Na Na You've been a really big help. But could you do me one more favor? When I preview my sprite animation it doesn't loop, it goes forwards, left right left right, forwards.(the frames per second). If you could help I'd really appreciate it. Thx!

  • @VagnerBueno
    @VagnerBueno 4 года назад

    Dude, I don't know what to say. This tutorial series changed everything for me.
    I've got here by chance knowing ABSOLUTELY NOTHING about programming. But I finally did it. I made a video for my song VOIDER based on these platformers style.
    Shaun, it wouldn't have happened without you, and that's why your name is included in the "Special Thanks" session at the end of the video.
    I would be very glad if you could check it out, or even read this comment. Anyways, THANK YOU!
    Vagner, Brazil 🇧🇷

  • @PrinzessinRamode
    @PrinzessinRamode 4 года назад +3

    Thanks! This was helpful. I had been trying with the drag and drop style for so long. I got them to work most of the time, but it was always slightly off. This was quite helpful.
    Can you make a tutorial for SNES style racing games like Top Gear (Top Racer in Japan and Europe)? :)
    These games aren't Mode 7, just typical behind the player camera that only moves forward (can't turn around).

  • @Spike-kg3zy
    @Spike-kg3zy 4 года назад +4

    Does anyone know why I'm just snapping through the floor. After a certain amount of time, the player just zooms straight down. Is it something to do with the gravity constantly increasing?

    • @Shibi_Cherry
      @Shibi_Cherry 4 года назад +2

      Did you set the collision mask in the centre?

    • @JustinKoenigSilica
      @JustinKoenigSilica 4 года назад +1

      did you limit your gravity to be set to like, 10 when it goes over that amount?
      are you resetting gravity when you touch the floor?

  • @Datoneguy_9343
    @Datoneguy_9343 Год назад

    I cannot thank you enough for zooming in during the code writing part

  • @beemckeith4856
    @beemckeith4856 6 лет назад +12

    How can you put in a double jump mechanic??

    • @bearwynn
      @bearwynn 6 лет назад +2

      make a variable and call it number of jumps, when you jump reduce the number by 1, then when it's at 0 make it so you can't jump anymore

    • @funnyvalentine5935
      @funnyvalentine5935 6 лет назад

      @@bearwynn can you teach me how to do that in game maker studio 2 language pls?

    • @GodOfTetris90
      @GodOfTetris90 6 лет назад +2

      hi, if you still dont make it to double jump try this.
      in Create Event, create a variable name it d_jump =1;
      now go to step Event and copy this after the jump code:
      if (!place_meeting(x, y + 1, obj_wall )) && (key_jump) && (d_jump > 0)
      {
      vsp = -7;
      d_jump -= 1;
      }
      if (place_meeting(x, y + 1, obj_wall )) d_jump = 1;
      now you will have double jump

    • @blitzy7742
      @blitzy7742 6 лет назад +1

      @@jeykang1540 you call that simple (; its not for a beginner

    • @osmarreisandrade
      @osmarreisandrade 6 лет назад

      @@GodOfTetris90 it didnt work, maybe cause of the "place_meeting" requirement of the object wall i guess :-:

  • @wodosdf107
    @wodosdf107 4 года назад +4

    8:05 I’ve put all of the code in correctly but they all have an error saying
    “Variable *that line* only referenced once”
    Any help?

    • @emilianomanuel2635
      @emilianomanuel2635 4 года назад +3

      ignore it, once you write the movements in step it will disappear , thats just game maker saying "hey, you declared some variables and havent used them... you need them?"

    • @wodosdf107
      @wodosdf107 4 года назад

      Emiliano Manuel Thanks for the help!

    • @mase8444
      @mase8444 4 года назад

      @@emilianomanuel2635 thank you king

  • @KikonSketches
    @KikonSketches Год назад

    Finally! A comprehensive guide for the absolute beginner! Thank you so much!

  • @daris-oddy5919
    @daris-oddy5919 5 лет назад +6

    after the Vertical movement my character didn't move anymore
    pls help

    • @wileywilson
      @wileywilson 5 лет назад

      Double check your code matches Shaun's. I've just followed this through after downloading GM2 yesterday and it works fine.

    • @onecanvanbam6775
      @onecanvanbam6775 5 лет назад

      I had a similar issue and it was that I'd left a hsp in where we copy and paste it for vertical collision, check there maybe?

    • @AnnaMc456
      @AnnaMc456 5 лет назад

      I had a similar issue. The problem was that my character's "hitbox" or "frame" (for lack of better term) was overlapping with the ground (or wall, in this video). So, the character couldn't move because it had been instructed to not move upon collision, and collision started as soon I ran the game. The solution was to simply move the character away from the ground (or wall).

  • @Temzy
    @Temzy 6 лет назад +4

    Wonderful tutorial, instant sub!

  • @chillinglord7829
    @chillinglord7829 4 года назад +2

    damn, better than every tutorial I usually turn off at variables when they explain but you explained to good your the hero we needed but never desreved

  • @onetrueandrew
    @onetrueandrew 7 лет назад +8

    What is the best way to become proficient in GML and Game Maker Studio 2? Obviously tutorials and trial and error, but any other suggestions for learning?

    • @onetrueandrew
      @onetrueandrew 7 лет назад +9

      I've put in a week's worth of time and practice. It paid off. Submitted my first game, Recoil, to the GMTK jam tonight. Thanks for everything you've taught! Check me out on itch. io if you like, creator name is brotherpixel.

    • @garoldgoatgaming2923
      @garoldgoatgaming2923 7 лет назад +2

      I just played your game and it's a lot of fun!

  • @sdsada42424
    @sdsada42424 7 лет назад +7

    Guys can someone help? Whenever I touch my platform, the game freezes and I can't close it without using the task manager.

    • @lzmkova
      @lzmkova 6 лет назад +1

      me too

    • @custerfreestyle
      @custerfreestyle 6 лет назад +4

      im sorry you just have a trash pc :/

    • @deeper2147
      @deeper2147 6 лет назад +2

      No.. i's just in the vertical collision.. idkw but if you write : +sign(vps) it won't work. But if you you want it to work and no freez you have to type +vsp (without the sign)

    • @Suzurinn
      @Suzurinn 6 лет назад

      @@custerfreestyle Shaun just made a fuck up with his coding. While I'm unsure of why it worked for his footage (probably editted it in later), I can say even with a high end pc it still freezes the game in a loop. So nothing to do with pc hardware, just an error in code. Anyone trying to make games would be a moron to instantly assume its someones hardware first. Poor programmer, that type of person.

    • @SeanMarbaugh
      @SeanMarbaugh 6 лет назад

      It's because of the while loop being used to push the player right up to the ground.

  • @ZackDaly
    @ZackDaly 4 года назад

    Thank you SO much for this tutorial series! It has been INVALUABLE in my programming education. Keep up the great work!

  • @RaposaCadela
    @RaposaCadela 6 лет назад +4

    "hsp = move * walksp;" makes my game not open, for whatever reason. I tried to close and open the project back again, and now the interface is all gone, and I can't get it back!

    • @MotoXJuan
      @MotoXJuan 4 года назад

      i did the same thing. turns out i had my step code in create, and create code in step, when it should have been the other way around

  • @goob30
    @goob30 4 года назад +5

    The code keeps giving me this error: "Variable (blank) has only been referenced once."

    • @lunasoldev
      @lunasoldev 4 года назад +2

      Thats because variables like key_jump arent used yet dont worry about this error its not bad its gonna be fixed later!

    • @goob30
      @goob30 4 года назад +1

      @@lunasoldev i watched the entire vid and nothing was fixed -_-

    • @lunasoldev
      @lunasoldev 4 года назад

      @@goob30 just keep going with the tutoriald sn whete exactly does it say the error

    • @hulyacekmez460
      @hulyacekmez460 4 года назад

      change controls to right A left D key so it works. you can do it like this: key_left = keyboard_check (ord ("A"));
      key_right = keyboard_check (ord ("D"))
      It happens if you do the same.

    • @futurevisionarchives3995
      @futurevisionarchives3995 4 года назад

      @@goob30 basically ignore it until it is used again, it simply means the code doesn't have another instance of running

  • @levelupgames5807
    @levelupgames5807 8 месяцев назад

    Thanks Shaun, Best beginner video I seen by far. Easy to understand and follow

  • @jacklewis256
    @jacklewis256 6 лет назад +4

    1:15 pause the vid and shake your phone lightly and the squares move

    • @cheezed675
      @cheezed675 6 лет назад

      Some people aren't watching on their phones.

    • @Husqe2019
      @Husqe2019 6 лет назад +4

      then shake your friggin' gameboy gosh

  • @leedleleedlelee6912
    @leedleleedlelee6912 5 лет назад +5

    nothing is appearing when im pressing play, help plz
    edit: nvm j was running the wrong room

  • @knightbender2
    @knightbender2 2 года назад

    Very well explained! If you make a mistake just rewatch and find where you mistyped, because its all written down as it should in the video.

  • @airgwgie869
    @airgwgie869 4 года назад +4

    my player kept falling inside the wall however it still moved and was about to jump out, idk what to doooo

    • @vell3445
      @vell3445 3 года назад

      I have the same problem

    • @no-cm5yq
      @no-cm5yq 3 года назад

      Same here, you got a fix?

    • @vell3445
      @vell3445 3 года назад

      @@no-cm5yq I did

    • @no-cm5yq
      @no-cm5yq 3 года назад

      @@vell3445 what is ir

    • @vell3445
      @vell3445 3 года назад

      @@no-cm5yq some one in the game maker server gives me a collision code that never stuck with wall

  • @foggy9874
    @foggy9874 5 лет назад +11

    For the absolute begginers, if you need your player to handle double jump instead of 1 jump in a very simple way:
    if (place_meeting(x, y + 1, oWall))
    {
    moreJump = 1; // variable to set the maximum number of jumps, you can change the value to 2 or 3 or more if you want to add more jumps.
    if (key_jump) vsp -= 7; // don't forget the basic one jump when you're on the ground
    } else {
    if (key_jump and moreJump > 0) {
    vsp = 0; // reset the gravity before jumping again!
    vsp -= 7; // jump again !
    moreJump -= 1;
    }
    }

  • @xDMrGarrison
    @xDMrGarrison 2 года назад +1

    I did not think it would actually be this easy to get this much stuff. This is exciting.

  • @Cynicaall
    @Cynicaall 6 лет назад +6

    Hello there, im very new to this but i had an error occur, i placed in the correct coding you've shown in the video, followed all the right steps but... when i had opened my game, my square (the player) moved on its own to the right then it had left off of the game screen, my key controls didn't move it, or anything. i decided to try this again and had the same issue. my keys work just fine, because i play games that use the key functions. Could you maybe help me out? or try to figure out a solution to this error,

    • @MrWebcammer
      @MrWebcammer 6 лет назад +1

      Hey! Just in case you haven't found an answer to your problem yet double check make sure you are doing everything in the same way he does in the video. It can be confusing to follow along at times but it's always good to pause and go through the code character by character after every line to learn it. Also it sounds like somewhere you're telling the object to move positively along the x axis aka to the right. He does this in the first while statement so I'd check your code there first. Good luck!

    • @mont.s6513
      @mont.s6513 6 лет назад +1

      i had the same problem! just check that instead of having x = x + hsp, it’s y = y + vsp
      was trying to figure out what was wrong for about an hour, hahaha. hope it helps!

    • @EmberEngine
      @EmberEngine 6 лет назад +1

      The same thing happened to me, and then I realized I put a + instead of a *.

    • @HuseyinC.K.
      @HuseyinC.K. 6 лет назад

      İ deleted the while parts for both vertical and horizontal, worked for me.

  • @tai5517
    @tai5517 7 лет назад +7

    When I hold alt the Sprite does not show up... Help

    • @PivotBoom
      @PivotBoom 7 лет назад +1

      You probably forgot to make objects with the sprites
      Or your gamemaker is broken D:

    • @exbonentialstudios7830
      @exbonentialstudios7830 7 лет назад

      You may not have the right layers selected :)

    • @ananthatekklur6882
      @ananthatekklur6882 6 лет назад

      maybe you have background selected instead of instances.

    • @shoe7393
      @shoe7393 6 лет назад

      Click on the actual object instead of the sprite on the resources

    • @chuksk8592
      @chuksk8592 6 лет назад +2

      Hold alt gr, on the right side of the space bar

  • @Josh_42069
    @Josh_42069 Год назад

    As a brand new dev I found this reasonably difficult at sometimes I wanted to quit and throw my computer up against a wall but after an hour or 2 and a few fixes this works really and this was a really good tutorial thanks so much I can't belive that this 5 year old tutorial still works :)

  • @bluegamer4210
    @bluegamer4210 6 лет назад +4

    27:04 my player yust sticks it self on the wall
    help

    • @pds1789
      @pds1789 4 года назад

      you probably wrote something wrong in the collision code. The same thing happened to me.

    • @mr.memeteacher3846
      @mr.memeteacher3846 4 года назад

      this is rly late but I had the same problem, it was cause when i was created the verticle collision i had put '+sign(vsp)' for both place_meetings

  • @taimjnaidi8156
    @taimjnaidi8156 10 месяцев назад +5

    Horizontal collision ain't working

  • @erwansellin4791
    @erwansellin4791 7 месяцев назад

    Thanks! It was fun. Anybody who wants to add double jump by deleting the impossibility to jump mid-air, just replace his jump code by this:
    if place_meeting(x,y+1,oWall)
    { jump =0

    }
    if (key_jump) and jump

  • @Mallikowski
    @Mallikowski 7 лет назад +11

    if i jump into a wall im stuck there, gravity doesnt work then. how can i fix that ? great tutorial btw :) ty man

    • @jacobblack5175
      @jacobblack5175 7 лет назад +8

      git gud

    • @CaptSlapster
      @CaptSlapster 6 лет назад +1

      make a check for horizontal collision into walls.

    • @kornknight6383
      @kornknight6383 6 лет назад +1

      Make sure your origin point is set to middle centre for all of your sprites. :)

  • @jasongomez7210
    @jasongomez7210 7 лет назад +30

    how about making an advance platdormer tutorial?

    • @NickoTyn
      @NickoTyn 7 лет назад +2

      Gloomy Toad has started a great tutorial series for a more advanced platformer with interesting features like momentum, friction or even jetpack.
      @Shaun I think you should definitely include your tile collision in this series. It is so much easier to work with tiles after you setup the system and tiles are one of the best features of GMS2.

    • @AndrewWooldridge
      @AndrewWooldridge 7 лет назад +3

      Remember this is not so much about the ending game as it is teaching you how to use the Gamemaker Studio 2 UI and coding.

    • @lauknload
      @lauknload 7 лет назад +5

      An inventory system would be neat.

    • @aresiel
      @aresiel 7 лет назад +3

      Jason Gomez Before you go to advanced you should properly learn that it's called platformer and not platdormer!

    • @NickoTyn
      @NickoTyn 7 лет назад +10

      God forbid someone make a typo on the internet because the rage of the GoldenPuma will bash him into the ground.