Player collision and state reset [#5 Remake Undertale in GameMaker ]

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

КОМЕНТАРІ • 11

  • @heartbae87
    @heartbae87 5 місяців тому +4

    Finally an undertale tutorial that actually teaches battle coding

    • @1upIndie
      @1upIndie  5 місяців тому +1

      Glad you found what you are looking for.

  • @thegreenshilltophomesteadg7006
    @thegreenshilltophomesteadg7006 5 місяців тому +3

    Love ya man! Keep up the work :)

    • @1upIndie
      @1upIndie  5 місяців тому

      Thanks for watching!

  • @1upIndie
    @1upIndie  5 місяців тому +1

    Videos code:
    Create event:
    hitTime = round(1.8 * 60);
    hitTimer = hitTime;
    Step event:
    // time total for being hit/invulnerable
    hitTimer--;
    if(hitTimer < 0){
    hitTimer = hitTime;
    hitBlinkTimer = hitBlinkTime;
    image_alpha = 1;
    state = "idle";
    }
    #region collisions
    var collInstance = collision_rectangle(bbox_left,bbox_top,bbox_right,bbox_bottom, obj_Enemy_Bullet_Parent, 0,0);

    if(collInstance != noone and state == "idle"){
    state = "hit";
    }

    #endregion

  • @onebitterbit
    @onebitterbit 5 місяців тому +1

    Thanks for the tutorial! another lesson!!

  • @eunit08
    @eunit08 5 місяців тому +1

    Can't wait for the next tutorial 😢

  • @AidinZolghadr
    @AidinZolghadr 5 місяців тому +1

    What are your thoughts on the newly introduced "move_and_collide()"? Does it fully replace old collision detection method with place_meeting() in your opinion?

    • @1upIndie
      @1upIndie  5 місяців тому +1

      It is one of the best additions to the engine. It pretty much reduces tons of code for all directions and you can use it for tilesets and instance collisions. I personally love it. Will is replace all collision codes? Nah, there are still things you need to do manually, but for basics topdown movement or a platformer it is a god send (so here, yes it replaces it and makes it more convenient).

    • @AidinZolghadr
      @AidinZolghadr 5 місяців тому

      @@1upIndieThanks, are there any use cases in a platformer that it won't support fully?