added farming animation mechanic
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Babushka.scripts.CSharp.Common.CharacterControls;
|
||||
using Godot;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.Farming;
|
||||
@@ -14,9 +15,10 @@ public partial class PlantBehaviour2D : Node2D
|
||||
[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 growth stage.
|
||||
/// </summary>
|
||||
@@ -25,6 +27,8 @@ public partial class PlantBehaviour2D : Node2D
|
||||
if (_field.FieldState != FieldState.Watered)
|
||||
return;
|
||||
|
||||
GetTree().CallGroup("PlantGrowing", Player2D.MethodName.PlayFarmingAnimation);
|
||||
|
||||
switch (_state)
|
||||
{
|
||||
case PlantState.None:
|
||||
@@ -58,7 +62,7 @@ public partial class PlantBehaviour2D : Node2D
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
_field.UpdateFieldState(FieldState.Tilled);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user