How do I convert mouse co-ordinates in Slick2d java?

Posted by Trycon on Game Development See other posts from Game Development or by Trycon
Published on 2012-10-25T09:54:49Z Indexed on 2012/10/25 11:16 UTC
Read the original article Hit count: 179

Filed under:

I'm really new in Java and I really want to how do I convert the mouse clicks to co-ordinates in game. My game moves its images so that the camera could stay with the character. I follwed thenewboston tutorials. I have been modifying new codes for smoother gameplay. I have been searching the web for tutorials. This is one of the codes:

PosGameX=MouseX+0;


PosGameY=MouseY+0;

I have not try this code but, I really think this would not work. The website I have visited, I think, is not good for coding. My gameplay is that when the mouse clicks on a position. It would try to get the co-ordinates(Mouse) and convert it to game co-ordinates. And I really want to know how do I make my mouse clicks to game co-ordinates?

FOR MORE INFO: Searches: How Do I translate game co-ordinates? How Do I translate mouse to game co-ordinates?

AND PLEASE! Do not give me algebra. I have really forgotten those.

© Game Development or respective owner

Related posts about slick