Add saves, settings, and multiplayer-safe menus
This commit is contained in:
parent
e2067e3bf4
commit
0d050b08cc
32 changed files with 2468 additions and 49 deletions
|
|
@ -14,6 +14,18 @@ func get_balance() -> int:
|
|||
return current_balance
|
||||
|
||||
|
||||
func restore_balance(balance: int) -> bool:
|
||||
if balance < 0:
|
||||
return false
|
||||
var previous_balance: int = current_balance
|
||||
current_balance = balance
|
||||
balance_changed.emit(
|
||||
current_balance,
|
||||
current_balance - previous_balance
|
||||
)
|
||||
return true
|
||||
|
||||
|
||||
func can_afford(amount: int) -> bool:
|
||||
return amount >= 0 and current_balance >= amount
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue