Added hash salt, added game data saving
This commit is contained in:
parent
6ffa6e643b
commit
11ea0f0d51
7 changed files with 43 additions and 51 deletions
|
|
@ -49,19 +49,14 @@ func bought_action():
|
|||
var primary_slot = ship.get_node("PrimaryWeapon")
|
||||
var secondary_slot = ship.get_node("SecondaryWeapon")
|
||||
var bought_weapon = get_tree().current_scene.bought_weapon
|
||||
var weapon_dict = get_tree().current_scene.weapon_dict
|
||||
var slot = primary_slot if data["slot"] == "primary" else secondary_slot
|
||||
if !bought_weapon[data["weapon"]]:
|
||||
bought_weapon[data["weapon"]] = true
|
||||
else:
|
||||
ship.money += price
|
||||
if slot.get_child_count() == 0:
|
||||
var weapon_inst = load(weapon_dict[data["weapon"]]).instantiate()
|
||||
slot.add_child(weapon_inst)
|
||||
slot.position = data["position"]
|
||||
else:
|
||||
for node in slot.get_children():
|
||||
node.queue_free()
|
||||
var weapon_inst = load(weapon_dict[data["weapon"]]).instantiate()
|
||||
slot.add_child(weapon_inst)
|
||||
slot.position = data["position"]
|
||||
for node in slot.get_children():
|
||||
node.queue_free()
|
||||
var weapon_inst = Game.get_weapon(data['weapon']).instantiate()
|
||||
weapon_inst.id = data['weapon']
|
||||
weapon_inst.position = data["position"]
|
||||
slot.add_child(weapon_inst)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue