I’m a totally newbie if it comes to Phaser and I have two main questions about it (we’re talking about Phaser 3 here).
I’m gonna provide a little bit of context: so I’m creating a game, where math equations are falling from the top of the canvas, on the bottom there are spikes, if math equation reaches the bottom it’s being destroyed and a life is taken from the player. The player has to provide answers for the lowest math equation on the screen, before it gets to the spikes.
I’ve setted up codesandbox with what I’ve got now: https://codesandbox.io/s/2woopqx1vy
I want to embed this game inside React project, so my first question is how to properly use it with React, because I want to trigger actions on impact with spikes etc, that will update score, lives and push it to the backend after the game is finished.
The second question is: how to get always the lowest equation on screen (closest to the spikes) in a way that user can put answer in an input and it’ll be checked with the lowest equation (node?). For now I have only falling circles. I want to somehow get always the lowest circle visible and check if the string equation that it has is answered correctly, if yes the score should be increased and equation removed from the screen.
Any help will be much much appreciated.