GameMaker Studio Tutorial - 2D Hack-n-Slash #21: PLAYER HUD

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

КОМЕНТАРІ • 17

  • @josemoreno6417
    @josemoreno6417 6 років тому +13

    Man, I love ya so much, I'm pretty happy to see that you keep teaching other people about GameMaker and programing in general, thanks for all you do for us.

  • @schaxor3807
    @schaxor3807 6 років тому

    Best GMS2 tutorial I've seen so far, at least when it comes to using scripts. Can't wait for next one :)

  • @erzloh
    @erzloh 6 років тому +2

    Hey! Thank you for the tutorials, I hope the next episode will come soon! :D

  • @LuisFlores-gr1bw
    @LuisFlores-gr1bw 6 років тому

    Awesome lesson!

  • @Sho-px3zi
    @Sho-px3zi 6 років тому

    Wow thats awesome! Helped a lot! Thank you :D
    Keep it up!

  • @clockso2574
    @clockso2574 6 років тому +4

    Dis game is starting to look rly good
    btw is it possible to put the code in obj_hud in obj_skeleton that way instead of having to type o_skeleton.hp we can just type hp

    • @GrahamErmter
      @GrahamErmter 6 років тому +1

      Yes however it would be probably considered bad practice to do something like that. Makes it more confusing when going back to your code later

  • @tb7094
    @tb7094 6 років тому +1

    Nice video. I have a question, is there a specific reason, why you use the draw_rectangle_color function instead of the draw_healthbar function? The second have a few more options to customize the healthbar.
    Have a nice day everybody.

  • @ReversePrimeOFFICIAL
    @ReversePrimeOFFICIAL 6 років тому +1

    Hi i injoy your videos I am really bad at pixel art could I use the sprite layout “the RPG Game” but change the colors and the details and put your name in the credits and give you that I used the layout and what changes? Oh thanks on helping me I bought your rpg and tile sets keep up your work

  • @soco5338
    @soco5338 6 років тому

    Is there a reason you use draw_rectangle_colour instead of draw_healthbar?

  • @thisyoutubeishaunted
    @thisyoutubeishaunted 6 років тому

    Does anyone have any suggestions for an equally smooth health regen? I can get it to refill using certain conditions (eg. not moving + button press) but it's an instantaneous refill rather than something that takes several steps to complete. Alarms have zero effect, however - I think maybe because of the lerp function...? I'm not quite sure.

  • @Omar-vp1cf
    @Omar-vp1cf 6 років тому

    Hey! Does anyone how I would be able to implement a jump mechanic I’ve been trying to figure it out but I’m stumped.

    • @patrykwinczewski4343
      @patrykwinczewski4343 6 років тому +1

      I'm new to this, but maybe you can make a jump state, check if input.jump is pressed, and then, if it is pressed, inside your jump state use script to change sprite to jump sprite,
      And then check, if your animation is between frames when your character should be going up and set its speed on y-axis,
      Then check if animation is between
      Frames your character should be going down, and if it is, change its speed on y-axis to go down, after this, check if animation has ended, and if it is, change state to move.
      Well, I hope it helps, but I haven't tested it, and probably there is million better ways to do this. As I said, I'm new to this, so sorry if it doesn't work.
      PS: sorry for my English :p
      PS2:I just thought, you should make sure that your character is going down the same distance as he does while going up, this will prevent changes in character's orginal position

    • @Omar-vp1cf
      @Omar-vp1cf 6 років тому

      Thank you so much for the reply! I will try this tonight and let you know if I can get it work.

  • @CAESAR_IS_GOD_mohammadisaloser
    @CAESAR_IS_GOD_mohammadisaloser 5 років тому +1

    Create in oHud
    var camera_id = view_camera[0];
    var view_width = camera_get_view_width(camera_id);
    var view_height = camera_get_view_height(camera_id);
    display_set_gui_size(view_width, view_height);
    Draw Gui in oHud
    if not instance_exists(Player) exit;
    var hp_percent = (Player.hp / Player.max_hp) * 100;
    draw_healthbar(8, 8, 500, 20, hp_percent, c_black, c_red, c_lime, 0, true, true); .........easy health bar code for 1920x1080p game.

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

    health bar is juicy