Player-field manipulations
This commit is contained in:
parent
9ced321538
commit
74759e9e16
21 changed files with 270 additions and 54 deletions
|
|
@ -4,6 +4,7 @@ using System;
|
|||
|
||||
public partial class RuntimeLevelData : Node
|
||||
{
|
||||
[Export]
|
||||
public int SunCount { get; private set; } = 0;
|
||||
|
||||
public override void _Ready()
|
||||
|
|
@ -15,13 +16,15 @@ public partial class RuntimeLevelData : Node
|
|||
{
|
||||
SunCount += amount;
|
||||
}
|
||||
public void SpendSun(int amount)
|
||||
{
|
||||
SunCount -= amount;
|
||||
}
|
||||
|
||||
public bool TrySpendSun(int amount)
|
||||
public bool CheckSpendSun(int amount)
|
||||
{
|
||||
if (SunCount - amount < 0) return false;
|
||||
|
||||
SunCount -= amount;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue