GameMaker Studio 2 - Wall Jumps with momentum

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

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

  • @SaraSpalding
    @SaraSpalding  6 лет назад +48

    "Approach" is a script, not a built in gamemaker function. For those looking to emulate the exact acceleration code I used you can get the script here: pastebin.com/7gzJTLKj

    • @ben4627-p8o
      @ben4627-p8o 6 лет назад

      thanks

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

      can't get the script o/

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

      @@littlericeball1872 /// Approach(a, b, amount)
      // Moves "a" towards "b" by "amount" and returns the result
      // Nice bcause it will not overshoot "b", and works in both directions
      // Examples:
      // speed = Approach(speed, max_speed, acceleration);
      // hp = Approach(hp, 0, damage_amount);
      // hp = Approach(hp, max_hp, heal_amount);
      // x = Approach(x, target_x, move_speed);
      // y = Approach(y, target_y, move_speed);
      if (argument0 < argument1)
      {
      argument0 += argument2;
      if (argument0 > argument1)
      return argument1;
      }
      else
      {
      argument0 -= argument2;
      if (argument0 < argument1)
      return argument1;
      }
      return argument0;

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

      thanks my hero

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

      I suppose it's possible that I'm just being silly, but what exactly is the advantage to using this "Approach" script instead of just using a lerp function? They look like essentially the same thing to me -- am I overlooking something?

  • @digitalswordplay
    @digitalswordplay 6 лет назад +47

    As a compliment to this video would you be able to cover ledge grabbing ?

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

      did you ever figure it out? I've been trying for ages but cant seem to get it to work

  • @al-farsigames538
    @al-farsigames538 6 лет назад +2

    Phew! I finished the tutorial and the sliding works perfectly with my game. Thank you so much, Shaun. And keep it up!!

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

    This is really great! I renamed walljumpdelay to hsp_momentum and I'm using it for a lot of other moves too.

  • @burningoak545
    @burningoak545 2 года назад +6

    Hi all, getting some flickering between sprites and a very slow approach to the collision when I've applied this to my own project. Any thoughts on why this might be?

  • @Evanski
    @Evanski 6 лет назад +33

    You and Heart beast should collab for the next Ludum Dare

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

    thank you Shaun, now i can start make the game that i dreamed years and years to make!

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

      Come on man, tell us how the game is going! You haven't ditched your dream, right?

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

      Huh, I'm becoming curious myself. How is it going man?

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

      My pc broke 2 months ago, but I still have the game file on my Pen Drive. maybe i will put it on itch.io when i fix my pc!

    • @ZDubbz
      @ZDubbz 10 месяцев назад

      how's it going?

    • @blob7115
      @blob7115 9 месяцев назад

      hows the game going?

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

    For those of you who have problem about Player motion not running, try to add this code, because for me it worked :
    hsp = (key_right - key_left) * hsp_walk;
    put it in oPlayer, then in the "Step" section at the end before the code:
    if (hsp != 0) sprite_index = OPlayer_BlueWalk; else sprite_index = OPlayer_BlueIdle;

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

    How would you go about adding a skidding animation when changing direction with the current setup?

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

      Nevermind, I came up with a decent solution
      if hsp > 1 && key_left || hsp < -1 && key_right
      {
      sprite_index = sPlayer_Skid
      }
      else
      {
      if (hsp != 0) sprite_index = sPlayer_Run; else sprite_index = sPlayer;
      }
      maybe there's a cleaner way of doing it but whatever

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

    If you have topic suggestions you can add them here: goo.gl/forms/sjOznhhFQgJo5TBD2
    HOWEVER, topics are ultimately selected by patreon supporters ( www.patreon.com/shaunjs ) in polls. I only use these suggestions to help determine what sort of things should be in the polls.

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

    Another amazing and very interresting video ! It 's very well explained, I'm french and I I understand very well. His videos are addictive, I see 20 video of shaun in 2 days :)

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

    Hi, quite new to the GML language, how you you wall jump only from running and jumping as opposed to standing still next to a wall and then still sliding down the wall? if that makes sense. at the moment, if I am stationary next to a wall and jump it still applies the slide effect. thanks

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

    Great!
    I have a question. I'm not sure anyone is still on here to answer, though.
    QUESTION: If the character is touching a wall, and simply wants to jump over it, the wall jump will inevitably kick in, thus forcing the player to stand a few pixels away from the wall (one would do the trick) before attempting again. So I'm thinking I'll make a different wall type for wall jumps to solve this, and will therefore have to select what walls can be wall-jumped and what walls cannot. But if you have any other ideas, I'd love to read about it.
    EDIT: Ohhh... this is happening, of course, because I have double jump as well. So normally for a higher wall, the character would double jump. But now I'm thinking of removing it, and making wall jump the only way to get higher. Double jump is disabled while touching the wall to enable wall jump at the moment. See what I've gotten myself into? The character's a cat. Cats don't double jump, but it's so satisfying.

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

    Anybody know how to add variable jump height?

  • @m4theussszz
    @m4theussszz 5 лет назад +4

    I didn't use friction and my character just doesn't move against the wall
    pls help meeeeee ;-;

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

      11 months ago but in the unlikely chance your still trying, make your origin point middle center like the rest of your sprites, mess with collision masks, and the collision of the air sprite

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

    Also question, how can i translate this into a dash jump. Im mostly using your platformer tutorial as my base as its my first time doing all this. Im having a hard time figuring out how to keep the dash speed when i jump.

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

    I can only get the wall jump working on the left side. On the right, he just slides down with jump doing nothing. I've seen a few comments on this issue

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

    Player is unable to move once they hit the ground, how do i fix this?

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

      Probably a bit late but I had the same issue and it was collision, since my jump sprite had a shorter collision box relative to the center point when landing this would jam the bottom of the standing sprite into the wall and stop if from moving sideways as it was stuck colliding with the wall. I just set the sollision mask of the player to be the same as the standing sprite, but the prper fix is probably making all your sprites the same size at the edges collision wise

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

    I wrote everything exactly as shown in the video, but for some reason the movement doesn't work and jumping makes my sprite disappear. Anyone have any ideas what might be causing this?

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

    Im having the same problem as a couple of other people here, the character can jump and everything else but is unable to walk, but i did find out that if you get yourself between a wall above you and a wall below you the character walks as he should but reverts to being unable to walk after landing once after a jump, i cant seem to find any problems or differences in the status calculating code, if anyone has any clues please help me out.

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

    Thanks for another awesome tutorial, all videos have really helped me so much and I really appreciate the work you do.
    so my question on this topic, I feel like my player fall speed is really fast and Im trying to slow it down a bit, trying to give my player more an arch feel. For me, it just feels like the jump is too stiff, Im hoping that makes sense. I've adjusted my code in various places but haven't really nailed down where I can slow things down a bit.
    I modified the VSP_MAX value, but this affects the jump height and if i lower it, my player only jumps a few pixels.
    Can you provide some guidance a bit on how I can further control the speed of this jump and fall without affecting the jump height?
    Thanks!

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

    I have a concern. I pretty much copied everything here, and the game runs. The issue is, as soon as my sprite hits my oGround block, my player sprite falls through it.

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

    Hi, I know this is a super old video, but is there another video tutorial explaining the "moving with acceleration" code used in the players horizontal movement? I used it a few years ago and I can't find the original video for it, and i'm not sure if it originates from here.
    Many thanks!

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

    hey man ,i love your tutorials . will you make one about doing a double press dash too ? that would be awesome.

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

      you could set up an alarm[0] for the movement keys where the alarm starts on the first press, and if the second press of the same key happens before the timer/alarm runs out, perform the dash/enter dash state where you can mess with the sprite change, animation, dash speed, invulnerability, stamina, etc. You can mess with the duration of the alarm to your liking depending on how fast you want the player to press the keys to dash.
      And once the dash animation is done, exit out of that code/state back to the normal movement state/code and you can continue.
      //You can exit out of the state using a simple if statement within the dash state
      if animation_end()
      {
      state = "move";
      }
      Setting up a stamina makes sure you can't just keep spamming dash to escape enemy attacks or cover huge distances in a very short time unless that's the clear intention. From here, it's all your design decisions taking priority.
      If you have no idea what I'm talking about, do check out Finite State Machines, they're amazingly useful. Shaun and Heartbeast both have excellent tutorials on it.

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

    If someone can help with Approach it would help a lot, my player can jump but it cant move

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

      Check the pinned comment, Approach is a script, and Shaun put a pastebin link to what the script should say.

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

    Hey Shaun, thanks for the video, for some reason my character can only jump and walking does not work, does anyone know how to fix that? Edit: Removing the hsp = 0 in horizontal movement seems to work but breaks wall jumping, i'm trying to find that code in your video but i havent been able to :/

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

      did you find a way? Im having trouble myself

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

      @@gregsmillems4578 This is super late but I had the same issue and the problem was collision masks, my jumping sprite would change the bottom of the collision mask to be shorter than my standing sprite, when landing this would bump the standing collision into the wall object and lock it from walking sideways, as a quick fix I changed the object to use only the collision mask of the standing sprite.

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

    That's cool and all but how did you assign variables in the Approach, part I tried the Dir var ,hsp value 0 and the friction, wut variables are in there ?????? im confused

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

    There's a problem. If you're facing left and you're colliding with a wall to your right and jump you will wall jump but your player will be facing the wrong direction any fix?

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

    Hi Shaun, whenever I try to do my walljump I can do it fluently but if i stay on the wall to slide down too much it'll automatically jump onto the other wall. This only happens with the wall behind me. Any help is appreciated. Thanks.

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

    Quick question to Shaun or anyone else that is having an similar issue... well not really an issue, but I've gone through the tutorial and everything seems to work fine but whenever I jump against a wall I push off of it automatically. Ideally for a wall jump you want to jump towards a wall and then when you are sliding on the wall you press jump again to get to the other wall. The way the code is written you automatically jump off the wall as soon as you hit it, so you can conceivably just hold down your jump button and it will do the wall jumping for you all the way up to the top... anyone know what I might be missing in my code or what to modify? - I've triple checked the tutorial and can't find any difference. Cheers, thanks.

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

      Update: nevermind, I had the jump key set to "keyboard_check" rather than "keyboard_check_pressed"

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

    Anyone know how to jump onto the left wall from the right wall???? Its not letting me slide or wall jump at all!! PLEASE HELP!!

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

    very nice tut! so i was wondering, how to provide the wall jump a "coyote time" since people prefer pressing the opposite direction to the wall!

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

      You need to add another type of delay;
      When the character touches/is touching the wall but is not touching the ground, set it to max; when you hit jump, set it to 0. Allow jumping whenever this delay is > 0.

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

    Anyone got suggestion on how to control/adjust gravity? I am too stupid to figure it out myself. I just feel gravity is currently too forceful (got a very small res game) but when I change the gravity the 'fall' off a wall is not a smooth arc.
    Great tutorial though!

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

    i have a really weird problem, all of this is working perfectly, but literally only on the right side. i cant wall jump on the left and i cant even see the sprite change to the wall jump one making me think it might be collision. if anyone has an idea as to whats wrong id appreciate the help :0

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

    My player randomly sticks to the wall when I just try to implement the animation change. Anyone else have this issue and know how to solve it?

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

      Try changing the collision on your sprites

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

      @@fuglfiringar6989 What do you mean? The collision box? I have changed it a few times, it doesn't fix anything :(

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

      @@aricleighton sorry man im new to game maker to. Idk whats wrong :/

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

    For some reason when I run the game, nothing responds. Is this happening to anyone else?

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

    Olá tudo bem eu enviei um jogo pra Playstore e ele foi rejeitado fala para atualizar a libpng mais não sei como fazer isso pode me ajudar?

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

      Translation: Hello I sent a game to Play Store but it got rejected, it's saying to update libpng but I don't know how to do that, can you help me?

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

    The pastebin kind of confuses me.
    What part of it am I using and what = what if I'm trying to make walking acceleration?

  • @josh.5942
    @josh.5942 5 лет назад

    So, on my game, everything is working great except that it only give me the momentum backwards on walls to the left, and not walls to my right, does anyone have a solution?

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

    Is there a reason I am scaling the wall simply by touching it?

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

    I don't know if this is my problem but I tried reducing the ground friction and when I tried it I saw that the player speed when onground and dir=0 was beig decreased not smoothly- It changed to a fixed slower speed, then to a slower one and then the player was still. Shouldn't it be smooth?

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

      It happens the same when you slide down a wall, first it goes at a speed and then at the max speed. All code is correct if i checked well.

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

    hey shaun, how you doing. i just finish you tutorials and work just fine. the problem came when i tried to arrange the code into state machines with enums. i have a problem when i slide on the left walls. the mechanics work but the sprite dont work. what make me crazy its that the rigth walls works fine. Edited:
    Nvm I fixit it, I was asumming onWall was a boolean

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

    my character sprite slides perfectly on the left but it wont flip when i jump onto the right wall

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

    should this code wrok on gm1?

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

    pure class !

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

    what about the approach function

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

    what is standing in your draw event?

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

      The dust particles I'm pretty sure

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

    What is an alternative for "Approach" in GameMaker 1.4?

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

      Approach is a script that works in any version! Get it here: pastebin.com/7gzJTLKj

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

      Thanks! I was wondering about this myself. I'm using GMS2 and "Approach" wasn't working for me. Maybe add the script to the description?

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

      I'm having this same issue. Anyone figure this out?

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

      Nik Slabysh just copy the script Shaun posted into a script and call it approach

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

      Shaun Spalding the "approach" variable isn't working here. Is it possable they changed the functionality of it?

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

    Even with the following, I´m still getting weird x values for my player such as 546.15.. but after adding it I don´t get stuck when getting too close to walls so I guess it´s working as intended? Does anyone know? Sorry I´m just a lowly noob :)
    hsp += hsp_frac;
    vsp += vsp_frac;
    hsp_frac = frac(hsp);
    vsp_frac = frac(vsp);
    hsp -= hsp_frac;
    vsp -= vsp_frac;

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

    Hey Shaun, love your vids! Helps me a lot!
    But, will you be making GameMaker : Studio (Original) tutorials?

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

      I've made lots of videos for 1.x that all still apply. Given most stuff is backwards compatible I tend to only cover 2.x going forwards.

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

      Shaun Spalding Okay, Thanks Shaun!

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

    why when I try to start the game it tells me that there is a mistake in line 15

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

      my program looks like
      /// Imputs
      key_left = keyboard_check(vk_left);
      key_right = keyboard_check(vk_right);
      key_jump = keyboard_check(vk_space);
      // Calc horizontal movement
      var dir = key_right - key_left;
      hsp += dir * hsp_acc;
      if (dir == 0)
      {
      var hsp_fric_final = hsp_fric_ground;
      if (!onground) hsp_fric_final = hsp_fric_air;
      hsp = Approach(hsp,0,hsp_fric_final);
      }
      [HERE] hsp = clamp(hsp,-hsp_walk,hsp_walk);
      //Clac vertical movement
      vsp += grv;
      //Ground Jump
      if (jumpbuffer > 0)
      {
      jumpbuffer--;
      if (key_jump)
      {
      jumpbuffer = 0;
      vsp = vsp_jump;
      vsp_frac = 0;
      }
      }
      vsp = clamp(vsp, -vsp_max,vsp_max)
      //Dump fractions and get final integer speeds
      hsp += hsp_frac;
      vsp += vsp_frac;
      hsp_frac =frac(hsp);
      vsp_frac =frac(vsp);
      hsp -= hsp_frac;
      vsp -= vsp_frac;
      //Horizontal Collision
      if (place_meeting(x+hsp,y,Owall))
      {
      var onepixel = sign(vsp);
      while (!place_meeting(x+onepixel,y,Owall)) x += onepixel;
      hsp = 0;
      hsp_frac = 0;
      }
      //Horizontal Move
      x += hsp;
      //Vertical Collision
      if(place_meeting(x,y+vsp,Owall))
      {
      var onepixel = sign(vsp);
      while (!place_meeting(x ,y+onepixel,Owall)) y += onepixel;
      hsp = 0;
      hsp_frac = 0;
      }
      //Verticale Move
      y += vsp;
      //Calc current status
      onground = place_meeting(x,y+1 ,Owall);
      onwall = place_meeting(x+1,y,Owall) - place_meeting(x-1,y,Owall)
      if (onground) jumpbuffer = 6;
      //Adjust sprite
      image_speed = 1;
      if (hsp != 0) image_xscale = sign(hsp);
      if (!onground)
      {
      if(onwall !=0)
      {
      sprite_index = SPlayer_wall;
      image_xscale = onwall;

      }
      else
      {
      dust = 0;
      sprite_index = SPlayer_air;
      image_speed = 0;
      image_index = (vsp > 0);
      }
      }
      else
      {
      if (hsp != 0) sprite_index = SPlayer_run; else sprite_index = SPlayer;
      }

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

      アルバン.. it may be the scripts line, I’m an experienced coder and I would just double check the script before running your game. I’m also probably late to this comment as it’s later on but I hope this helps.

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

    Cool😍 that's what I want to learn

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

    I imported the sprite code, where you animated the sprite and now I get stuck in the ground

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

    Question: Does Game Maker Studio 2's complete edition support Android Export?

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

      Yeah

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

      "Complete" edition?

    • @7_rlz_714
      @7_rlz_714 6 лет назад

      can you make a tutorial about how export android devices?

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

      Robiie liao he has made one for 1.x that is still compatible

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

      Game Hub the ultimate edition does

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

    i cant even get on the wall, anyway someone can help me?

  • @fierorecensione5828
    @fierorecensione5828 10 месяцев назад

    Thank you!!!

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

    How much does it cost? And where can I buy it? Talking about Game Maker Studio 2

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

      Yeah I still can't find it in my area :/
      Asked my friends and the same result

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

      www.yoyogames.com/

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

      Yeah thanks! Just found out there were some problems with some of my extensions that weren't letting me into the website

  • @studio-mm7402
    @studio-mm7402 2 года назад

    Code?

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

    very helpful!

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

    onepixel...is this a local variable it says it needs to be declared and stays blue in my code? and also grv_final

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

    single wall climbing do be mega man x styled.

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

    Splendid! Maybe Wall Slide next?

    • @SaraSpalding
      @SaraSpalding  6 лет назад +9

      That's covered in this! Unless I'm not understanding?

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

    Thank u so much for your videos these have helped me sooo much but one question and actually rather a request if possible, how to make enemies follow the player for e.g a zombie game but not top down instead for a platformer (so they know how to go around rooms that havent been "open" if that makes any sense and path finding for platformers please) love ur content fan since ur 4th video 😁

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

      (In other words since i found ur channel😂)

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

      In game maker 1 you can do
      Mp_potintal_step()
      And it will walk to a given rage to what ever object x and y you put in the () im not sure about gm2 but it might be the same

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

    i can't used "Approach"

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

    I'm trying to complete a Pokemon game but I'm unable to do the ledge jump Shaun can you help with an RPG tutorial.

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

    been waiting for this

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

    Hey Shaun,
    Firstly thanks you're doing a great job,
    Keep going
    I wanna ask what if I type this code in game maker studio 1???
    I mean will it run???

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

    Great!

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

    but why the wall shaped like among us

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

      Cos everything is if you look hard enough :p

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

    min 0:46 that is Sussy
    Amogus

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

    Hey Shaun... on line 65 where you're doing:
    onwall = place_meeting(x+1, y, oWall) - place_meeting(x-1, y, oWall);
    Wouldn't it be just as good, or even better, to do :
    onwall = place_meeting(x+1, y, oWall || place_meeting(x-1, y, oWall);
    ?
    That way:
    - if you're caught perfectly between walls at left and right, you could still wall jump.
    - if GML ever decides to implement boolean data type, so that true and false aren't 1 and 0 and can't be subtracted, the code would not break.

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

      Unfortunately no. The subtraction makes a distinction between left and right (-1 and 1) and doing an Or would only return a "true" if one or both walls were touched. You'd have to do something else to calc both sides.
      But you are right about the hypothetical data type issue.

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

      Really each should probably be checked separately then combined into a single var.

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

    ok but how to make him claiming like in celeste

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

    The dust particles aren't showing

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

    who can show me here the full code.. thanks

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

      raymundo melecio it’s better to learn yourself

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

    Hey man. Your "Approach" script is wrong. Why don't you check the information in your videos? This isn't the fist time, you know.
    Anyway...
    For those who have an issuer with the "Approach" script and the "undefined value" error, here is the right script:
    if argument0 < argument1
    {
    argument0 += argument2;
    if argument0 > argument1
    {
    return argument1;
    }
    }
    if argument0 > argument1
    {
    argument0 -= argument2;
    if argument0 < argument1
    {
    return argument1;
    }
    }
    return argument0;

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

      I can't make it work! How did u do? Everytime i try to run the game the error "undefined value" hits, tryied everything already! Can u help?

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

      @@lucasdestruction Hi. Did you try my script, that I left in this comment?
      Basically, you create a script, name it: Approach. Copy my code from this comment and paste it. Everything else from this video have to work.

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

      @@Oliwarder Yeah already copy and pasted. No work for me :(
      Here's the code:
      function Approach()
      /// Approach(a, b, amount)
      // Moves "a" towards "b" by "amount" and returns the result
      // Nice bcause it will not overshoot "b", and works in both directions
      // Examples:
      // speed = Approach(speed, max_speed, acceleration);
      // hp = Approach(hp, 0, damage_amount);
      // hp = Approach(hp, max_hp, heal_amount);
      // x = Approach(x, target_x, move_speed);
      // y = Approach(y, target_y, move_speed);
      {

      if argument0 < argument1
      {
      argument0 += argument2;
      if argument0 > argument1
      {
      return argument1;
      }
      }
      if argument0 > argument1
      {
      argument0 -= argument2;
      if argument0 < argument1
      {
      return argument1;
      }
      }
      return argument0;
      }

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

      @@lucasdestruction Look at the first bracket in your code. I mean this one { Delete it.
      Just left only my code in the script.

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

      @@Oliwarder Still not working, here's what its look now:
      function Approach ()
      {
      if argument0 < argument1
      {
      argument0 += argument2;
      if argument0 > argument1
      {
      return argument1;
      }
      }
      if argument0 > argument1
      {
      argument0 -= argument2;
      if argument0 < argument1
      {
      return argument1;
      }
      }
      return argument0;
      }