Classes In Godot Are Amazing!

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2024

ความคิดเห็น • 12

  • @ceredev
    @ceredev 2 ปีที่แล้ว +25

    Super cool! May I suggest something?
    If every weapon has the same attributes in the class, instead of extend the weapons you can use a Resource which will tell to the instantiated class which data read. For example: you can have a rifle and a pistol. The difference is the cadence and the spray, so you can use the same class, but having two Resources: one containing the Pistol info and other one the Rifle info. In that way you can split behaviour and data, making it more flexible.

    • @Chaff_Games
      @Chaff_Games  2 ปีที่แล้ว +7

      Thanks, this is a really cool idea. I might look into it in the future.

    • @Gabu_
      @Gabu_ 2 ปีที่แล้ว +11

      I'll second this, and wholeheartedly recommend anyone watching this tutorial to look into using custom resources wherever applicable. The editor UI is still a little clunky when it comes to generating new custom resources, but that's easily overlooked when considering how much decoupling data from behavior speeds up the whole design-to-implementation process.

  • @chance_E
    @chance_E 2 ปีที่แล้ว +6

    Nice, I like Godot for these reasons as well. I've been making videos on Godot too. Been slacking lately because of school, but trying to get back into it. Really good video!

    • @Chaff_Games
      @Chaff_Games  2 ปีที่แล้ว +1

      Thanks, it can be so hard to keep the rhythm up sometimes. Keep at it 😊

  • @hery8148
    @hery8148 11 หลายเดือนก่อน +2

    if I've understood correctly, classes simplify the definition of certain functions, such as damage, and extends define what the node's inheritance represents. But if I make, for example, a knife, a pistol and a rocket launcher, how do I make knockback, damage and ammunition different and define them as inventory items for certain characters? Or for characters with different abilities and weapons, for example a normal speed sniper who climbs and a slow warrior with a charging minigun, do I have to make a specific class for each character class? And is there a difference between doing it online or solo?

    • @Chaff_Games
      @Chaff_Games  11 หลายเดือนก่อน +3

      Watch my video on resources and perhaps even my full tutorial on an fps weapon manager. I use resources almost exclusively for all of this stuff now as it handles these kinds of things much easier

  • @MaoXP
    @MaoXP ปีที่แล้ว +3

    I wish there was a way to implement arms with this code

    • @Chaff_Games
      @Chaff_Games  ปีที่แล้ว +4

      Hey, yeah. Earlier this month I started working on arms and it's a completely different workflow 😣. I'll need to post a new video at some point.

  • @Szabbyhun
    @Szabbyhun 2 ปีที่แล้ว

    So classes are something like: ScriptableObjects in Unity?

    • @quirkyzigzag
      @quirkyzigzag 2 ปีที่แล้ว +4

      no, classes are classes

    • @quirkyzigzag
      @quirkyzigzag 2 ปีที่แล้ว +2

      scriptable objects are objects that are scriptable, I guess you can compare them but classes are not a new invention, in unity you can make a gameobject that derives from a class