Add new resources and presenters for item pickups and effects
This commit is contained in:
@@ -57,6 +57,7 @@ public partial class GamePresenter : Node
|
||||
_world.RegisterSystem(new AttributeSystem());
|
||||
_world.RegisterSystem(new PickupSystem());
|
||||
_world.RegisterSystem(new InventorySystem(_world));
|
||||
_world.RegisterSystem(new ItemAcquisitionSystem(_world));
|
||||
|
||||
_world.RegisterSystem(new WeaponSystem());
|
||||
_world.RegisterSystem(new ProjectileSystem());
|
||||
@@ -75,7 +76,7 @@ public partial class GamePresenter : Node
|
||||
_presenters.Add(playerData.Entity.Id, playerData.Presenter);
|
||||
_presenterComponents.Add(playerData.Entity.Id, playerData.Components);
|
||||
}
|
||||
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
_inputService?.HandleInputEvent(@event);
|
||||
|
||||
@@ -21,6 +21,7 @@ public partial class PickupPresenter : Area3D, IEntityPresenter, IPresenterCompo
|
||||
{
|
||||
if (_presenterRegistry.TryGetEntity(body.GetInstanceId(), out var hitEntity))
|
||||
{
|
||||
GD.Print($"Collision detected between {CoreEntity.Id} and {hitEntity.Id}");
|
||||
_world.AddComponent(hitEntity, new CollisionEventComponent(CoreEntity));
|
||||
}
|
||||
}
|
||||
@@ -30,7 +31,6 @@ public partial class PickupPresenter : Area3D, IEntityPresenter, IPresenterCompo
|
||||
CoreEntity = coreEntity;
|
||||
_world = world;
|
||||
_presenterRegistry = GetNode<PresenterRegistry>("/root/PresenterRegistry");
|
||||
BodyEntered += OnBodyEnter;
|
||||
}
|
||||
|
||||
public void SyncToPresentation(float delta)
|
||||
|
||||
1
Code/Presenters/PickupPresenter.cs.uid
Normal file
1
Code/Presenters/PickupPresenter.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ck82xby5qe680
|
||||
Reference in New Issue
Block a user