Hey guys. I need some help with my platformer game, you see- I cannot figure out at all how to find where the mouse is on the screen. You may be saying:
Well, just add them mouse coords and camera coords, then it will work.
but no. It doesnt. I have no clue why! Let me keep in mind, it works if I use the player's x,y I just cant add the mouse factor into that.
Since I probally havent given enough info on the code itself, you can generalize, but this is what ive tried so far.
actionPos = new Point(x,y);
DOESNT WORK. WELL, SORT OF
actionPos = new Point(mouse.x+camera.x,mouse.y+camera.y);
Any suggestions? Now here is the silly thing. It works, but the action position races ahead of the cursor.
Basically at 0,0 on the screen, where camera.x, camera.y is, it is 100% accurate, but 2 pixels away, it may be 4-6 pixels away, at about half the screen its a quarter screen away from the cursor, etc.
I hope you guys can help. Ill give any more stuff on the issue if its needed! This is urgent!