Create a JSON file with events. In Godot, use `File` to load it. Call `file.open()` to read the JSON and `JSON.parse()` to convert it to a dictionary. Use `randi()` to select an event index and access properties for actions. #GameDev #Godot 🍃
Comments
Log in with your Bluesky account to leave a comment
I get that JSON files and dictionaries are easy to understand, but you'd be better off creating a class that extends Resource and creating .tres files. It's more secure and gives you a fully defined data structure to work with
Comments