Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: EnterTheStory (aka tolworthy) on Mon 21/04/2008 18:29:10

Title: turning off pixel perfect detection for individual characters? {SOLVED}
Post by: EnterTheStory (aka tolworthy) on Mon 21/04/2008 18:29:10
Is it possible to selectively turn off pixel perfect clicking? I need to be pixel perfect for large or stationary characters, but small and fast moving characters are almost impossible to click on :)
Title: Re: turning off pixel perfect detection for individual characters?
Post by: SSH on Tue 22/04/2008 10:14:04
You can add custom code to check for clicks near them:


function mousenear(Character *who, int howclose) {
  int xd=mouse.x-who.X;
  int yd=mouse.y-who.Y;
  return ((xd*xd)+(yd*yd)) < (howclose*howclose);
}

Title: Re: turning off pixel perfect detection for individual characters?
Post by: Radiant on Tue 22/04/2008 16:14:54
One other way of doing it is by creating a large character that Follows the small/fast character Exactly, and is placed on top of it. If it's simply a big white square, you can click on it; and if you set its transparency to 100%, you won't actually see it.
Title: Re: turning off pixel perfect detection for individual characters?
Post by: EnterTheStory (aka tolworthy) on Wed 23/04/2008 08:43:33
Thanks for the suggestions. Sounds like they would work.

In this case I can't use ghost followers, since I have over forty characters on screen already, and AGS wont allow more than 50. And there are also issues with any extra code slowing down the scene.

I finally opted for a completely different solution: the small character problem is made much worse because they all look similar, and are all moving erratically. So I made it so the user can press the space bar to stop them, then clicking on one is much easier.

Thanks again for the ideas.