basic harvesting implemented
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Babushka.scripts.CSharp.Common.CharacterControls;
|
||||
using Babushka.scripts.CSharp.Common.Inventory;
|
||||
using Godot;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.Farming;
|
||||
@@ -15,6 +16,7 @@ public partial class PlantBehaviour2D : Node2D
|
||||
[Export] private Sprite2D[] _readyPlants;
|
||||
[Export] private PlantState _state = PlantState.None;
|
||||
[Export] private FieldBehaviour2D _field;
|
||||
[Export] private ItemOnGround2D _harvestablePlant;
|
||||
|
||||
private Sprite2D _currentPlantSprite = null;
|
||||
|
||||
@@ -52,6 +54,7 @@ public partial class PlantBehaviour2D : Node2D
|
||||
_state = PlantState.Ready;
|
||||
_currentPlantSprite.Visible = false;
|
||||
_currentPlantSprite = GetRandomSprite(_readyPlants);
|
||||
_harvestablePlant.IsActive = true;
|
||||
_currentPlantSprite.Visible = true;
|
||||
break;
|
||||
case PlantState.Ready:
|
||||
|
||||
Reference in New Issue
Block a user