mirror of
https://github.com/tonytins/citylimits
synced 2025-12-18 22:04:43 -05:00
Decoupling more hardcoded data
- Created a json helper to streamline decoupling of hardcoded data - Removed non-existent VR bridge reference - News ticker files are no longer hardcoded to the game. - Removed hardcoded city and mayor names using Json helper
This commit is contained in:
parent
f8a0f97767
commit
65cc08fab6
13 changed files with 309 additions and 417 deletions
|
|
@ -1,7 +1,10 @@
|
|||
extends Node
|
||||
|
||||
var city_name: String = "Furtropolis" # Hard-coded, for now
|
||||
var mayor_name: String = "Defecto"
|
||||
const DEFAULT_CITY = "defualt.json"
|
||||
const SAVE_PATH = "res://json/saves/"
|
||||
|
||||
var city_name: String = ""
|
||||
var mayor_name: String = ""
|
||||
var population: int = 0
|
||||
var budget: int = 20000
|
||||
var expenses: int
|
||||
|
|
@ -65,6 +68,13 @@ enum Ordinances {
|
|||
TIRE_RECYCLE
|
||||
}
|
||||
|
||||
func _ready():
|
||||
if city_name == "":
|
||||
city_name = JsonHelper.key_value(SAVE_PATH, DEFAULT_CITY, "city")
|
||||
|
||||
if mayor_name == "":
|
||||
mayor_name = JsonHelper.key_value(SAVE_PATH, DEFAULT_CITY, "mayor")
|
||||
|
||||
#func starting_budget(lev = Level.EASY):
|
||||
# match lev:
|
||||
# Level.EASY:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue