Closed JiboStore closed 1 year ago
Hey @JiboStore,
Thanks for creating this issue. That is definitely not the expected behaviour - I'll try debug this and get back to you. Just a heads up - I'm a bit busy with with this week.
Hi @bberak Thank you very much for your reply!
Actually I figured out that it actually works if I call stop() from the component that return ref
globally and get the entity and/or system to call the ref.stop()
which doesn't work. But if I `dispatch({type: 'stop-game'}) from entity and/or system and then inside the component that return
handleEvent(e) { if ( e.type == 'stop-game' ) { ref.stop(); } }
it will work.
I am not sure of the intended use though..
To be honest, I didn't quite understand reading your repo code lol.. I am quite new to javascript (although I have game-dev background on C++ and OpenGLES)
Hey @JiboStore, the way you've got it working now is the intended usage.. Apologies that the docs are quite sparse in many areas,. Totally understand that it looks quite foreign - plus it doesn't help that you need to have some knowledge of React to follow along.
Hope your project is going well in any case!
Expect: the entire simulation to be paused Reality: systems are still being called, entities are still ticking
const.js
let gameEngineRef = React.createRef()
game.js
insideoneofentities.js