WestonVincze/necro-vs-crown

Build UI event layer

Opened this issue · 1 comments

In order for BitECS and Svelte to "talk" we need to implement a robust event driven system. We need to update UI based on the "game state" and we need to invoke actions into our game loop from user interactions.

To maintain the flow of ECS, we'll create a buffering system (similar to the bufferedDeathEvents) to ensure new entities and components are created at the beginning or end of a frame.

We should minimize the amount of data that needs to be sent. The UI should receive the name/key of an upgrade, the EID of the entity getting the upgrade, and any necessary numeric values. The title, description, imageURL, and anything else should be stored as a shared resource.

This is now blocked by #37 and will be completed afterward.