Quick question. I have a TiledMap along wtih a camera (for the matrix) and a player object (with a Sprite attached). In my system I have the camera move to the middle of the map (for now, later I'll figure out a better starting position) . My update method handles moving the camera around (based on WASD keys) and then positions the player to where the camera is. Then my draw method will draw the map then the player (using the camera matrix).
All this is good except the camera is looking at the top left corner of the screen as it's origin point so the player is up there too. What I want is the camera to handle the map but the player to be in the middle of the screen.
Just wondering what the best option here is?
- Have the camera LookAt a new position (after moving the player) that's half the width and height of the screen
- Position the player so they're half the width and height of the screen away from the top left corner of the screen
I don't necessarily want to fix the player to the middle of the screen (using the viewport adapter) so I can get the tile under the player and that kind of stuff, so if I just apply the camera matrix to the player it all lines up with the map.
Let me know what you think (and I can provide a better explanation, code, images, etc. if you're not following this).