Godot 4 - Using Enums in GDScript for Better Code

Автор - Brett Makes Games ссылка - От автора: Enums in GDScript are a great way to manage state and limited options for variables. This video goes over how to define them, use them, and work with them in the Inspector in Godot 4. The concept is illustrated by adding a fire state to a play that handles firing one bullet or two. An anti-example is provided, then the code is refactored to show the value of enums. Source code:
Back to Top