Reloading Weapons and Managing Ammo (Godot Tutorial)

Поделиться
HTML-код
  • Опубликовано: 27 окт 2022
  • Godot node essentials: gdquest.mavenseed.com/courses...
    📚 THE LINKS
    Download the demo project: gdquest.github.io/godot-demos...
    ---
    👥 CREDITS
    Video edited by Nesi: / nesiawesomeness
    Host: @Aecert
    ---
    💌 JOIN US
    Come chat on Discord: / discord
    Follow us on Twitter: / nathangdquest
    ---
    📝 CC-BY LICENSE
    This video is licensed under the CC-By 4.0 license: creativecommons.org/licenses/...
    You can attribute it to "CC-By 4.0 - GDQuest and contributors - www.gdquest.com/"

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

  • @DustedAsh3
    @DustedAsh3 Год назад +1

    Thanks for the tutorial! It seems simple enough, I look forward to when I'm making a shooting mechanic next

  • @HarbingerSh
    @HarbingerSh Год назад +9

    We need a tutorial about how to build and destroy tiles and the tiles related to the tile you destroy (like what is above it) in 2d like in terraria

  • @JavaJack59
    @JavaJack59 Год назад +12

    Bookmark'd!
    My gut feeling is that showing/hiding the bullets in the HUD would be better than instancing/freeing, but that's just a hunch.

    • @OK-sw4jy
      @OK-sw4jy 7 месяцев назад

      I was thinking that too

    • @nosee4781
      @nosee4781 6 месяцев назад

      but what happens when you get extra magazine?

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

    Nice video, thanks for sharing

  • @renji-hjk
    @renji-hjk Год назад

    very nice mechanics i will implement in my game

  • @thef1rst1
    @thef1rst1 Год назад +3

    Hey could you make more platformer related tutorials thanks!

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

    Please what do you use to draw your sprite. I download Godot but i don't know what to use for sprites.

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

    What is call deferred in godot and what are the uses

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

    Can the ammo amount be like a 0 to 100% charge of electricity and then until a play loose the ability to recharge the power cell for phaser

  • @MrOuttheir
    @MrOuttheir 4 месяца назад

    Can someone please make a tutorial on script organization, and when to make new scripts?

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

    "I have a question, I would like to know if it is possible to apply bounce to the type of projectiles you use, or would I have to use a rigid body?"

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

    new to godot (why im watching tutorial for a concept im very familiar with). but the name "textureRects" when spoken sounds a lot like "texturex/texturecks"

  • @Joonysuke
    @Joonysuke Год назад +1

    Interesting take on this. I made a more intricate reload system back when I was learning Unity on Udemy, and the course itself didn't go very in-depth on the subject matter. A few months ago, I remade the system in Godot, with a few tweaks. The reloading is a bit more than what was shown here, but I did that due to bugs I was running into at the time. I also allowed for different weapon types (currently an AK and a Glock as options), with different fire rates, ammo reserves and so on using "Scriptable Objects". I'm curious to how your take would be on it to see if my code can be further refactored.

  • @user-vp6jp2tq2y
    @user-vp6jp2tq2y 4 месяца назад

    maybe somewhere left the demo because right now link doesn't work

  • @BinaryBolias
    @BinaryBolias 11 месяцев назад

    9:25
    ________________________________________________________________________________________________
    -var ammo_missing := max_ammo - _current_ammo-
    -if reserve_ammo >= ammo_missing:-
    -set_reserve_ammo(reserve_ammo - ammo_missing)-
    -_current_ammo = max_ammo-
    -else:-
    -_current_ammo += reserve_ammo-
    -set_reserve_ammo(0)-
    ________________________________________________________________________________________________
    var transfer_amount : int = min(reserve_ammo, max_ammo - _current_ammo)
    set_reserve_ammo(reserve_ammo - transfer_amount)
    _current_ammo += transfer_amount

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

    Why is _physics_process used instead of _process, is physics not used there?

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

      My guess is to ensure the rotation of the weapon and the firing process properly at runtime at the intended FPS. I could be wrong.

  • @Roleplay78
    @Roleplay78 Год назад +4

    I really dislike guard clauses with returns.
    Would way easier to read:
    If timer.is_stopped():
    Do something
    Also, the reloading timer could be a variable in the physics process, would save a timer node.
    Same thing for shooting timer. Use physics process to check bullet delay.
    This is also important if you want to fire multiple bullets per frame, is more maintainable.
    Also, as other pointed out, having a bullet pool is critical with high fire rate.
    The other way of doing it is to tween the clip directly.
    You will see the bullets going up and you will save a few timers and code.

  • @kermitfry1
    @kermitfry1 Год назад +6

    *Magazine. That is all.

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

    Why no reloading when there's some ammo in a clip? That's pretty essential in FPS games.

    • @Gdquest
      @Gdquest  Год назад +5

      You can reload when there's some ammo in the clip with this video's code. The only cases reloading doesn't happen are:
      1. The weapon's clip is already full
      2. You don't have any ammo left in the reserve

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

      @@Gdquest so the code in this video would work for a 3D game too

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

    pls make tutorial how to make game like a mobile legends

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

    😅😅😅😆😆🤮🤮🤮🤮