02-09-2021, 08:55 AM
(This post was last modified: 02-09-2021, 08:56 AM by MetalRenard.)
Hey! Going to use this as a place to keep track of my own progress learning GDScript (Godot). Some parts will be relevant to other scripting languages, thought it would be worth sharing and explaining it helps me learn, too.
Followed a few tutorials, watched and read a bunch of stuff. Today, trying to use a 'dictionary' to define level up stats and then call them from another script. First step: Learnt to create a dictionary that holds the data! Kind of a script database of sorts.
Followed a few tutorials, watched and read a bunch of stuff. Today, trying to use a 'dictionary' to define level up stats and then call them from another script. First step: Learnt to create a dictionary that holds the data! Kind of a script database of sorts.
Code:
extends Node
var stats = {
"hull": [6, 12, 18, 24],
"shield": [10, 20, 30, 40],
"shot": [8, 16, 24, 32],
"speed": [150, 200, 250, 300],
}