Enums | Godot GDScript Tutorial | Ep 11 | Godot Tutorials 5/8/23 4:40 PM
Courses / Introduction-To-Gdscript / Godot-Tutorials-Gdscript-11
Enums | Godot GDScript Tutorial | Ep 11
Enums | Godot GDScript Tutorial | Ep 11
PREV EPISODE NEXT EPISODE
Learning Materials
https://godottutorials.com/courses/introduction-to-gdscript/godot-tutorials-gdscript-11 Page 1 of 3
Enums | Godot GDScript Tutorial | Ep 11 | Godot Tutorials 5/8/23 4:40 PM
Article Resource
Enums
Enums, also referred to as enumerations, are a data type that contains a fixed set of constants.
Global Enums
enum {LEFT, RIGHT, UP, DOWN}
# Same as writing
const LEFT = 0
const RIGHT = 1
const UP = 2
const DOWN = 3
Local Enums
enum MOVE_SET {LEFT, RIGHT, UP, DOWN}
MOVE_SET.LEFT # 0
MOVE_SET.RIGHT # 1
MOVE_SET.UP # 2
MOVE_SET.DOWN # 3
Creative Common License
Enums | Godot GDScript Tutorial | Ep 11 video & article by Godot Tutorials is licensed under a Creative Commons Attribution-ShareAlike 4.0
International License .
Spread the love, share this if it helped you!
SHARE ON TWITTER SHARE ON FACEBOOK SHARE ON REDDIT SHARE WITH EMAIL
https://godottutorials.com/courses/introduction-to-gdscript/godot-tutorials-gdscript-11 Page 2 of 3
Enums | Godot GDScript Tutorial | Ep 11 | Godot Tutorials 5/8/23 4:40 PM
Subscribe to my Newsletter
Join our newsletter and get news in your inbox! We hate spam too, you
won't get any from me :)
Email... SUBSCRIBE
GODOT TUTORIALS
WEBSITE RESOURCES LEGAL OTHER
Courses Godot Privacy Policy Contact Me
Trello Cookie Policy Website Info
Github Terms & About Me
Conditions
Disclaimer
©2021 Godot Tutorials | Website Powered by Hugo Framework
https://godottutorials.com/courses/introduction-to-gdscript/godot-tutorials-gdscript-11 Page 3 of 3