Closed ravenwilde closed 1 year ago
Hi @ravenwilde,
Can you describe your use case in more detail?
The events
array will be contain event information for 1 frame after the dispatch
method is called on the GameEngine
component. When the frame completes the array is cleared.
This allows components outside of the GameEngine
to communicate with it and vice versa. So yes, you should be able to read events
info from the systems.
How are you sending events to the GameEngine
component?
Something like this should work:
//-- Assuming you have a ref to the GameEngine component
this.refs.gameEngine.dispatch({ name: "some-event-name" });
Hi @bberak , thank you for taking the time to respond. I ended up locating your demo app on npm and was able to figure out how to wire everything up. Nice work on this game engine! I'm shocked at how easy this has been to pick up and build with https://codesandbox.io/s/cold-resonance-5ywvz?file=/src/App.js
Thanks for the kind words @ravenwilde - let me know how it goes (always interested to see what people come up with)!
I'm consistently logging an empty
[]
array after an event fires - is there any way to access an events' type from within a system function?