Pursue, Evade, and Arrive in GameMaker Studio 2

Поділитися
Вставка
  • Опубліковано 19 гру 2024

КОМЕНТАРІ • 10

  • @jugibur2117
    @jugibur2117 7 місяців тому

    Thanks for your effort, really helpful!

  • @randomboar2025
    @randomboar2025 3 роки тому +4

    Your tutorials are REALLY great! How could I found your channel this late? Will definitely consider joining the patreon

  • @SeeNo
    @SeeNo Рік тому +2

    Thank you very much!

  • @karlstenator
    @karlstenator 3 роки тому +1

    This is my favourite GMS series of all time! Awesome work Sam.

  • @headspin4120
    @headspin4120 3 роки тому +1

    Thank you again!😀

  • @Zoyous
    @Zoyous 2 роки тому +1

    You mention at 3:30 that in this demonstration, you're referencing the Seeker object directly, but that you shouldn't do that in a real game. Could you explain a bit more about why?

    • @SamSpadeGameDev
      @SamSpadeGameDev  2 роки тому +1

      Sure. I'm referencing an instance of an object through the object id instead of the instance id. This works in GameMaker so long as there is one and only one instance of that object at any given time. So this wouldn't work if I had more than one seeker. And in general for that reasons it's also a bad practice to use an object id instead of an instance id. The exception are manager type objects where you know with certainty that there will be one, and only one instance of it ever existing at any given time.

  • @Robocat754
    @Robocat754 Рік тому

    Interesting! I wonder why after I released the evade key the npc is still fleeing when I'm moving in the same direction. I'm using WASD to control my character and if I'm multipling the player velocity by a big number. The NPC would always trying to move to the location that's far away from the player even if I'm right behind him.😅

  • @derpmorederp1417
    @derpmorederp1417 3 роки тому +1

    Working in a top down setting, I'm guessing if you wanted to change an enemies sprite based on direction, you'd compare the current velocity to future position too? Then that versus angles based on the current x/y?

    • @SamSpadeGameDev
      @SamSpadeGameDev  3 роки тому

      It depends, what I'm doing here is just getting the velocity angle, but it some cases it could be simpler (for example many top down games such as Nuclear Throne just flip the x axis) or more complicated (for example you want it to orient towards the direction it wants to even if some other force is pushing it in a different direction).