Skip to content

Having trouble creating an unbound game #1284

Answered by AlmasB
AliannejadiPourya asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, this sounds like a logic question, rather than an FXGL-specific question. I think it ultimately boils down to a data structure problem. My first thought is to go for something like a Map<Point2D, cell data> that allows you to keep track of all cells in the game and update as appropriate. Alternatively, you can try finding some resources on different ways to store your grid.

As far as the implementation related to FXGL goes, you can use getGameScene().getViewport().bind... to bind the viewport to your player entity, which will solve all the movement and camera problems.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AliannejadiPourya
Comment options

Answer selected by AliannejadiPourya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants