Make a Platformer in GameMaker! Part 5 (Sprite/Animation Control + Running/Sprinting)

Поделиться
HTML-код
  • Опубликовано: 28 сен 2024
  • Part 5 of 9! Download the sprites for this video at the link below!
    Sprite Folder (Public Patreon Post) : www.patreon.co...
    Wishlist Starcross Starcade Special! store.steampow...
    Rose of Starcross Trailer: https: // • Rose of Starcross Kick...
    Starcross Starcade Special Trailer: • Starcross Starcade Spe...
    My tweets: / peydinburnham
    Rose of Starcross Demo: peytonburnham....
    Discord: / discord
    My twitch: / peydinburnham

Комментарии • 52

  • @procrast3800
    @procrast3800 7 месяцев назад +14

    I just started using game maker with zero experience and it made me so happy to make a square move up and down then bump into a wall because of you so thank you so much. ALSO ur quality of life video is a hood classic.

    • @peytonburnham4316
      @peytonburnham4316  7 месяцев назад +4

      LMAO thank you very much my man I appreciate it 😎

  • @matthewlawton9241
    @matthewlawton9241 7 месяцев назад +9

    Just for fun, I edited the Maria jump sprite to be a sprPlayerFall and added
    //Falling
    if !onGround && ySpeed == termVelocity {sprite_index = fallSpr;};
    Once the player reaches terminal velocity, the jump sprite changes to a falling sprite where her legs are both stretched forwards and her hat lifts like the air was pushing it up.

    • @ng65gaming
      @ng65gaming 2 месяца назад

      Thanks for this, it's good to know animation can be customized like that

  • @lolerthegoat8603
    @lolerthegoat8603 3 месяца назад +2

    Hi everyone, I noticed that if you want to control also the frames of the sprite (let's say you use the controller and want to see the player walk at a slower pace), you can simply adjust the image_speed parameter to abs(moveDir).
    Example:
    //Walk
    if abs(xspd) > 0 {sprite_index = walkSpr; image_speed = abs(moveDir);}
    By simply doing this you can adjust the speed with the lever on your controller and notice the change in the walking speed on the walking sprite.
    Oh... and btw if you want to use the lever of the controller to walk you can simply do this:
    right_key = keyboard_check(ord("D")) + gamepad_axis_value(0, gp_axislh);
    right_key = clamp(right_key, 0, 1);
    left_key = keyboard_check(ord("A")) - gamepad_axis_value(0, gp_axislh);
    left_key = clamp(left_key, 0, 1);
    I don't know if it also will happen to you but when I use the lever analog data from the movement it is never -1/0/1, it can be also float numbers so I changed the code by changing 0 with 0.01, this because the controller lever as I said is never a full integer.
    Adapted code:
    //Walk
    if abs(xspd) > 0.01 {sprite_index = walkSpr; image_speed = abs(moveDir);}

  • @chillraven6181
    @chillraven6181 7 месяцев назад +4

    peyton has starcross fully come out yet either way yiu got me into game design

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

      Starcross Starcade Special is coming out this year! I'll definitely be doing an update on that soon!

  • @Mafeijora
    @Mafeijora 7 месяцев назад +9

    It feels criminal to be this early

  • @autismandgaming4532
    @autismandgaming4532 5 месяцев назад +2

    I found that the walking code you went with was prone to crashing, so I went with this as a comromise:
    if xspd > 0 { sprite_index = walkSpr; };
    if xspd < 0 { sprite_index = walkSpr; };
    I'm not sure what in your code I was working wrong, but at least I got it working

    • @MergeFox
      @MergeFox 36 минут назад

      I also had a similar problem with that line of code, but instead of 2 lines of code, you can efficiently write it as...
      if xspd != 0 { sprite_index = walkSpr}

  • @AnthonyGourmand
    @AnthonyGourmand 5 месяцев назад +1

    tips for GM if you rename your image with strip and the number like "exemple_strip4" it's will strip it in 4 (in this case) when you drag it into GM

  • @MatTheInsomniac
    @MatTheInsomniac 2 месяца назад

    If you're having issues with your character paper maria-ing when walking in different directions and dissapearing when idle (but only when a controller is connected), it's likely an issue for if you added joystick support. I fixed it up for me by adding rounding and it works. If you're having these issues, replace what defines your right and left keys (in the general_functions script) with this and it should work! Here:
    rightKey = keyboard_check(ord("D")) + keyboard_check(vk_right) + gamepad_button_check(0, gp_padr) + round(gamepad_axis_value(0, gp_axislh));
    rightKey = clamp(rightKey, 0, 1);
    leftKey = keyboard_check(ord("A")) + keyboard_check(vk_left) + gamepad_button_check(0, gp_padl) + round(gamepad_axis_value(0, gp_axislh)*-1);
    leftKey = clamp(leftKey, 0, 1);

  • @NovakiSalem
    @NovakiSalem 3 месяца назад

    was watching the subpixel problem wondering if it was just me messing up the code for several videos lol

  • @themc3140
    @themc3140 7 месяцев назад +9

    That outta pocket bit with miyamoto was really funny, I appreciated that.

    • @matthewlawton9241
      @matthewlawton9241 7 месяцев назад +1

      Did...did he show up at your door too? D:

    • @relaxolotlgames6460
      @relaxolotlgames6460 2 месяца назад

      @@matthewlawton9241 Yes, but it wasn't a bat... it was a hammer.

  • @nayrguy
    @nayrguy Месяц назад +1

    how could i do sprites for an asymmetrical character?

    • @vinimooraess
      @vinimooraess Месяц назад

      Instead of using the sprite scale to change direction, you would probably have to do it all in the sprite control, so when setting a sprite for walking and jumping, you would have to set one for walking left and one for walking right.
      To switch between the two you can simply check movedir, if it's 1 you use one direction if it's 0 you are going to the other direction.

  • @marknyilas9531
    @marknyilas9531 2 месяца назад

    ❤❤Can I use your character body and movements to create my own character?❤❤

  • @ginsginsuu
    @ginsginsuu 2 месяца назад

    if i don't have a use for the running section will that mess me up later or am i good to skip it?

  • @Xeanoz-w2d
    @Xeanoz-w2d 3 месяца назад

    12:53 "Then" I proceeded to write my second and third lines of code before it was shown in the video! WOOT
    Except I did the third one a little different. I'm not sure if this affects much?
    if ySpeed != 0
    {
    sprite_index = playerJumpSprite;
    }
    I completely forgot about onGround and my thought process was (from the absolute value of xSpeed) obj_Player will only be falling if ySpeed is -1 or 1.

  • @oooooooooegorova9717
    @oooooooooegorova9717 3 месяца назад

    Everything is fine, except for one thing. After I added draw_sprite_ext to the draw event, the sprite animation stopped working. How can I fix this? I did everything as in the video.

    • @oooooooooegorova9717
      @oooooooooegorova9717 3 месяца назад

      Ok, I found a solution. I added a custom image_speed to each movement where located the //sprite control.

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

    awesome tutorial

  • @kamehameguitar6166
    @kamehameguitar6166 5 месяцев назад

    hi. why is it that when I run to the left, the sprite does not change but is superimposed on top, it turns out that my character runs both to the left and to the right (((( I double-checked everything, found no errors,after adding the draw_sprite_ext function, this happens

  • @fireice8828
    @fireice8828 2 месяца назад

    Not sure if you are doing your arrays that way intentionally? But you can just do this: moveSpd = [2, 3.5];

    • @MergeFox
      @MergeFox 34 минуты назад

      I'm pretty sure he is doing that way to make it easier for newer people to understand.

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

    HERCULES STYLE >_

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

    would be cool if you showed a tutroial on how to make undertale fangames

  • @Eli_bcspn
    @Eli_bcspn Месяц назад

    19:33

  • @magnus.74
    @magnus.74 7 месяцев назад +5

    I love you Peyton

  • @Mikel726
    @Mikel726 4 месяца назад +1

    I have a jump animation that has multiple frames, but it keeps looping after I've already jumped. How do I fix that?

  • @edeeno
    @edeeno 7 месяцев назад +3

    Bro I’m so early to this

  • @Ratewstinky
    @Ratewstinky 7 месяцев назад +3

    Could you make a cutscene tutorial at some point? That would be really helpful! 🙏🙏🙏

  • @suyukisan_s1880
    @suyukisan_s1880 7 месяцев назад +1

    Hey Peyton! I followed your tutorials for making RPGs for beginners, could you tell me what the song in the videos is called? I’m obsessed

  • @Jhonnathan64
    @Jhonnathan64 25 дней назад

    with putting _strip (number of sprites you have) so that it adjusts automatically
    Example: asdas_strip3

  • @Xeanoz-w2d
    @Xeanoz-w2d 3 месяца назад

    17:11 --- could be used instead of the + and the clamp?
    That's what I did and have not had any issues YET.
    ...Also at 17:49 I attempted to figure this one out by myself and ended up with
    runType = abs(moveDirection * runKey);
    I was thinking since the moveSpeed array can only be 0 or 1, it can't be negative (absolute value) and it only applies when there's a moveDirection != 0.. if moveDirection is 0 the equation is 0, so player wouldn't be running?
    I did try this before pressing Play again and it seems to be working without any issues YET.
    It was also working while I was in the air, which felt weird, so I added one more line of code the runType code line
    if !onGround
    {
    runType = 0;
    }
    so far.... so good... YET?
    I'm a super beginner and literally these are my first lines of code and understanding of code ever. I do realize if the array for moveSpeed ever goes to [2] for any reason that my code breaks entirely because I don't know how to make that equation equal 0, 1, or 2.

  • @CraigHodson-e8m
    @CraigHodson-e8m 17 дней назад

    Locked in for this one, no mistakes and it looks wicked, thanks for the sprites too, having all the assets help make quick progress

  • @LF21Hungry
    @LF21Hungry 7 месяцев назад +1

    really nice to see another great tutorial from the best coding teacher i've ever seen videos of
    i actually didnt need the sprites cause i made my own in 15 mins lol

  • @MatTheInsomniac
    @MatTheInsomniac 2 месяца назад

    4:07 You sounded like the imessage message sent sound 💀

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

    Hey guys, so I have a weird bug. When I walk off a ledge now, my character floats (they can walk around in midair). This happens until I jump, then gravity kicks back in. Any ideas what I did wrong?

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

      Issue solved! I uh, accidently deleted the end of this line of code.
      if yspd >= 0 && place_meeting( x, y+1, o_wall )
      {
      setonground(true);
      } else {
      onground = false;
      }

  • @samufoxn7739
    @samufoxn7739 5 месяцев назад

    i think i might love u

  • @Quare_himself
    @Quare_himself 6 месяцев назад +1

    hey, i'm with a problem, whenever my character is idle he just ceases to exist.

    • @MatTheInsomniac
      @MatTheInsomniac 2 месяца назад

      Does he kind of paper mario himself back and forth when you walk? I'm having the same issue. Only happens when I have a controller connected.

    • @MatTheInsomniac
      @MatTheInsomniac 2 месяца назад

      Hi again! Fixed it! Apparently it has to do with joystick values not just being 0 or 1. Here's the code you should replace your right and left key stuff from the general_functions script:
      rightKey = keyboard_check(ord("D")) + keyboard_check(vk_right) + gamepad_button_check(0, gp_padr) + round(gamepad_axis_value(0, gp_axislh));
      rightKey = clamp(rightKey, 0, 1);
      leftKey = keyboard_check(ord("A")) + keyboard_check(vk_left) + gamepad_button_check(0, gp_padl) + round(gamepad_axis_value(0, gp_axislh)*-1);
      leftKey = clamp(leftKey, 0, 1);

  • @_mattbailey
    @_mattbailey 5 месяцев назад

    Hey Peyton. Is there a way to disable "Interpolate colours between pixels" globally or programmatically (so Maria doesn't look all blurry)? I found the option in Game Options, but you have to change it for each platform individually.

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

    I don’t know if you answer coding questions but In the game I’m making my player sprites design isn’t reversible so It can’t just be flipped on the x axis sadly. I couldn’t find any video really explaining how I could change my sprites to fix this issue.

  • @TheBendyMaster123
    @TheBendyMaster123 2 месяца назад

    Absolutely great tutorial series! It’s making me feel like an actual game developer! Can’t wait for more!

  • @GossLean
    @GossLean 7 месяцев назад +3

    Well, this gonna be a good day !