Initial Farming setup complete
This commit is contained in:
@@ -13,14 +13,18 @@ public partial class PlantBehaviour2D : Node2D
|
||||
[Export] private Sprite2D[] _bigPlants;
|
||||
[Export] private Sprite2D[] _readyPlants;
|
||||
[Export] private PlantState _state = PlantState.None;
|
||||
[Export] private FieldBehaviour2D _field;
|
||||
|
||||
private Sprite2D _currentPlantSprite = null;
|
||||
|
||||
/// <summary>
|
||||
/// Transitions the plant to its next groth stage.
|
||||
/// Transitions the plant to its next growth stage.
|
||||
/// </summary>
|
||||
public void Grow(int id)
|
||||
public void Grow()
|
||||
{
|
||||
if (_field.FieldState != FieldState.Watered)
|
||||
return;
|
||||
|
||||
switch (_state)
|
||||
{
|
||||
case PlantState.None:
|
||||
@@ -54,6 +58,8 @@ public partial class PlantBehaviour2D : Node2D
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_field.UpdateFieldState(FieldState.Tilled);
|
||||
}
|
||||
|
||||
private Sprite2D GetRandomSprite(Sprite2D[] sprites)
|
||||
|
||||
Reference in New Issue
Block a user