Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Khristian Cammilleri on Wed 01/05/2013 00:12:31

Title: Make the player face mouse coordinates in scrolling room [Solved]
Post by: Khristian Cammilleri on Wed 01/05/2013 00:12:31
Hi AGS community
I think that the title is pretty much self-explanatory, but I will explain it anyways:
I've created the following function:
Code (AGS) Select
function PlayerLookThings ()
{player.FaceLocation(mouse.x, mouse.y, eBlock);}


So everytime I run the interaction ''Look'', the player will face automaticaly the hotspot/object
Everything works fine in the non-scrolling rooms, because the mouse coordinates are 320x200..
My question is:
How could be a similar script for the scrolling rooms?? (more than 320x200 px)
Title: Re: Character face mouse coordinates in scrolling room
Post by: Khris on Wed 01/05/2013 00:21:28
Code (ags) Select
  player.FaceLocation(mouse.x + GetViewportX(), mouse.y + GetViewportY(), eBlock);
Title: Re: Make the player face mouse coordinates in scrolling room [Solved]
Post by: Khristian Cammilleri on Wed 01/05/2013 00:24:19
Wow Khris, That was fast!
Thank you for being in the other side of the screen answering all my silly questions :) :grin:
Title: Re: Make the player face mouse coordinates in scrolling room [Solved]
Post by: Khris on Wed 01/05/2013 00:36:38
Sure, you're welcome :)