🚧 reworked farming system to work with indices instead of positions
This commit is contained in:
@@ -22,6 +22,8 @@ public partial class FieldBehaviour2D : Sprite2D
|
||||
[Export] public ItemRepository ItemRepository;
|
||||
[Export] public InteractionArea2D FieldInteractionArea;
|
||||
[Export] public VariableResource _sceneKeyProvider;
|
||||
[Export] private VariableNode _fieldIndex;
|
||||
|
||||
|
||||
public Vector2 FieldPosition;
|
||||
|
||||
@@ -54,7 +56,7 @@ public partial class FieldBehaviour2D : Sprite2D
|
||||
public override void _Ready()
|
||||
{
|
||||
UpdateFieldState(FieldState);
|
||||
FieldService.Instance.TryAddEntry(_sceneKeyProvider.Payload.AsString(), (Vector2I) GlobalPosition, this);
|
||||
FieldService.Instance.TryAddEntry(_sceneKeyProvider.Payload.AsString(),_fieldIndex.Payload.AsInt32(), this);
|
||||
int randomIndex = new Random().Next(0, _maskTexture.Length);
|
||||
_maskSprite.Texture = _maskTexture[randomIndex];
|
||||
_outlineSprite.Texture = _maskOutlineTextures[randomIndex];
|
||||
@@ -139,5 +141,6 @@ public partial class FieldBehaviour2D : Sprite2D
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user