Hi guys,
I'm trying to program another 2D-Top-Down game in
Java and for the first time ever my gameworld (currently represented by a huge BufferedImage, later hopefully by around 200x200 16x16px tiles) is larger than my screen. Therefore I tried to make the camera move around, so that the player is always in the middle of the screen. Pretty basic.
My current approach sets my gamepanel to the size of the gameworld and moves the camera around with translating the graphics-object. This part works principally fine, but it totally screws up my MouseMotion-Events, with which I am controlling the players location. I tried to fix the screwed up MouseEvent.getX()/getY() results in various ways, but I can't get it to work properly
My question is, how do you guys track the player with the camera? Is there another approach I could try or do you know any tutorials/blogs which cover this topic? I'm totally clueless
I hope that this question isn't considered to general. If you need more data feel free to ask, but note, that I'm writing from my cellphone, since my laptop is short on internet in the moment.
Thank you!