Problem with Mouse Coordinates in a scrolling room

Started by rancidrat, Tue 08/05/2007 16:19:44

Previous topic - Next topic

rancidrat

Hi
I am currently working on a game where the player will have guns and be able to shoot at oponents. My battle system works great, I use objects for bullets:
The objects move to from the player to the mouse curser:

if (mouse click thing)
{
object[0].setposition(player.x,player.y);
object[0].move(mouse.x,mouse.y,......);
}

it works great but the problem I have is that in a scrolling room the mouse coordinates only stays in the 320 x 240 section of my room, so if the character is outside of this area the objects move back to that section of the room.
Is thier anyway to make the objects move to the cursor if the cursor is outside of the 320 x 240 screen coords?

GarageGothic

#1
Yes there is:

Code: ags
object[0].Move(mouse.x+GetViewportX(), mouse.y+GetViewportY(),....);



SMF spam blocked by CleanTalk