I am trying to make an rpg style game in javafx, which means that I need to repaint the screen every time the player moves or does an action. My game currently works so that it creates a new scene every time the player does an action, but this has proved to make the game very slow, as well as cause a host of other issues (music restarting). Would there be a way to update the canvas that I put on the screen and have that show to the scene but not recreate the whole scene?
I have tried to create a new canvas but the scene does not recognize the change in the canvas.
The system is a bit convoluted to show the entire path, but if anyone has questions regarding a specific aspect of the structure I would be happy to answer.
Basically, the scene has many elements on it, one of which is the canvas that is fetched from another class that has a method called getCavnas that returns the canvas.