Pursue, Evade, and Arrive in GameMaker Studio 2

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

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

  • @SeeNo
    @SeeNo Год назад +2

    Thank you very much!

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

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

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

    Thanks for your effort, really helpful!

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

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

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

    Thank you again!😀

  • @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).

  • @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.