mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-20 16:20:18 +01:00
Reload card store when reloading a level
This commit is contained in:
parent
7c96367d72
commit
00ec6f6700
2 changed files with 2 additions and 0 deletions
|
@ -15,6 +15,7 @@ func _process(_delta):
|
||||||
$Energy.text = str(game.energy)
|
$Energy.text = str(game.energy)
|
||||||
|
|
||||||
func load_card_store():
|
func load_card_store():
|
||||||
|
card_store = {}
|
||||||
var cards_json = JSON.parse(helpers.read_file("res://resources/cards.json")).result
|
var cards_json = JSON.parse(helpers.read_file("res://resources/cards.json")).result
|
||||||
for card in cards_json:
|
for card in cards_json:
|
||||||
card_store[card["id"]] = card
|
card_store[card["id"]] = card
|
||||||
|
|
|
@ -121,6 +121,7 @@ func load_level(level_id):
|
||||||
|
|
||||||
|
|
||||||
func reload_level():
|
func reload_level():
|
||||||
|
cards.load_card_store()
|
||||||
levels.reload()
|
levels.reload()
|
||||||
load_level(game.current_level)
|
load_level(game.current_level)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue