0
\$\begingroup\$

I rendered a tiled map, with the help of slick2d, in my JFrame in Java. I can move my main character, but it is just that the character itself moves. I would like to do it that, if the player moves, the map moves and the player himself stays in middle of the frame. Do you have any suggestions on how to do that ?

\$\endgroup\$
1
\$\begingroup\$

Don't use JFrame, instead use BasicGame subclass and AppGameContainer (it's much better than JFrame).

And to your problem, you have to create a Camera class. That's all already covered here.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.