Hey! Great question. I think I picked a bad example for the video because passing the actor into an _init() function makes perfect sense. This pattern is better suited for optional parameters. Something like the start of the video with the create_tween() function shows a better use case since those parameters are optional and have default starting values.
Good question! That can work too but it's not as readable and so I prefer chaining. There are also a few other tradeoffs (since chaining allows you to choose which properties you decided to pass in on creation).
Came here to make a similar comment. In this particular case, where the Mover needs an actor to work, and will fail in runtime if one is not provided, I'd ague it's more idiomatic to pass it via constructor. But chaining could still be valuable for more "optional" parameters (such as of looping/easing behavior in tweens).
@@watchagoblin Really good point! The example I picked to show the pattern isn't a great one and is causing some confusion. I do still like how readable it is, though. It's hard for me to let go of that even though I agree with your point.
@@uheartbeast Just to be clear, I still think the video is a good breakdown of the technique, and helpful in that regard! I think most programmers will be able to abstract away the specifics of a toy example, and focus on what the pattern itself enables them to do.
@@uheartbeast I think it'd be great if you can append this note in your description so people don't get confused or have to scroll through the comments to find this.
Hey! That's a good question. I'm going to copy paste my response from a different comment. I think I picked a bad example for the video because passing the actor into an _init() function makes perfect sense. This pattern is better suited for optional parameters. Something like the start of the video with the create_tween() function shows a better use case since those parameters are optional and have default starting values.
@@uheartbeast I guess that's fine. There can be different implementations for the same thing. Nonetheless you can still use the _init() constructor with optional parameters by specifying default values.
Plus, Godot (game engine) is open source and mostly funded by a non-profit organization of the same name, called the "Godot Foundation". Godot Games GbR (the board game company) is a company, not a non-profit. They make things for money. They're definitely not the same.
If all you need is to initialize, then create custom _init(args) function and pass arguments into new( args) when creating new instance.
Hey! Great question. I think I picked a bad example for the video because passing the actor into an _init() function makes perfect sense. This pattern is better suited for optional parameters. Something like the start of the video with the create_tween() function shows a better use case since those parameters are optional and have default starting values.
The intro never gets old
It gives me nostalgia
Glad you are back making yt video !
Heartbeast!👋glad to see you and your lessons again.
The goat is back
new banger just dropped
So sick. Never thought about doing this
This is usually called the "builder pattern" in non-game software.
Thanks for letting me know! It's probably called that in game software too. Now I can use the correct term for it.
saving this to watch later
He's back
and with facecam no less
Why not override the _init-method so you can pass the arguments upon creation
Good question! That can work too but it's not as readable and so I prefer chaining. There are also a few other tradeoffs (since chaining allows you to choose which properties you decided to pass in on creation).
Came here to make a similar comment. In this particular case, where the Mover needs an actor to work, and will fail in runtime if one is not provided, I'd ague it's more idiomatic to pass it via constructor. But chaining could still be valuable for more "optional" parameters (such as of looping/easing behavior in tweens).
@@watchagoblin Really good point! The example I picked to show the pattern isn't a great one and is causing some confusion. I do still like how readable it is, though. It's hard for me to let go of that even though I agree with your point.
@@uheartbeast Just to be clear, I still think the video is a good breakdown of the technique, and helpful in that regard! I think most programmers will be able to abstract away the specifics of a toy example, and focus on what the pattern itself enables them to do.
@@uheartbeast I think it'd be great if you can append this note in your description so people don't get confused or have to scroll through the comments to find this.
I don't understand the way you are instantiating. why not use _init() within the class and create the instance as className.new(...initial_props) ?
Hey! That's a good question. I'm going to copy paste my response from a different comment.
I think I picked a bad example for the video because passing the actor into an _init() function makes perfect sense. This pattern is better suited for optional parameters. Something like the start of the video with the create_tween() function shows a better use case since those parameters are optional and have default starting values.
@@uheartbeast I guess that's fine. There can be different implementations for the same thing. Nonetheless you can still use the _init() constructor with optional parameters by specifying default values.
Master!
👍🏼
Any update on any games or have you stopped working on everything?
Released a demo for WASarD on Steam and I'm still working on it. I'll don't have anything big to announce yet.
@@uheartbeast Glad to hear it man, sending good vibes and hoping it's going well, you've got a lot of talent
@@uheartbeast Oh good to know. I've had it wishlisted for some time now, will have to check out the demo.
hi :)
Does Godot 4.x have anything to do with Godot games (the board game company)? because if so they are a shit company.
Nope. I've never heard of the board game company, until now.
Plus, Godot (game engine) is open source and mostly funded by a non-profit organization of the same name, called the "Godot Foundation".
Godot Games GbR (the board game company) is a company, not a non-profit. They make things for money. They're definitely not the same.
I've never heard of the board game company
Unrelated