Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Sslaxx on Sat 24/04/2010 22:54:50

Title: Knowing when the player is over a hotspot.
Post by: Sslaxx on Sat 24/04/2010 22:54:50
I'm not sure if this is as simple as it sounds, but.

As the topic pretty much says - is there a way of knowing when the player character (sprite) is standing on (colliding with) a hotspot?

Thanks.
Title: Re: Knowing when the player is over a hotspot.
Post by: Dualnames on Sat 24/04/2010 23:24:44
I was available in 2.72, but I think it's now kind of obsolete. How about using a region instead?
Title: Re: Knowing when the player is over a hotspot.
Post by: Sslaxx on Sat 24/04/2010 23:28:01
Quote from: Dualnames on Sat 24/04/2010 23:24:44
I was available in 2.72, but I think it's now kind of obsolete. How about using a region instead?
Never even crossed my mind. Thanks! The only thing that comes to mind as would be nice is if there was a "hovering over the region" feature ala hotspots.
Title: Re: Knowing when the player is over a hotspot.
Post by: discordance on Sun 25/04/2010 22:17:29
You could also use


if (Hotspot.GetAtXY(player.x,player.y) == hHotspot1)


or whatever the name of the hotspot in question is.
Title: Re: Knowing when the player is over a hotspot.
Post by: Sslaxx on Sun 25/04/2010 22:34:06
Quote from: discordance on Sun 25/04/2010 22:17:29
You could also use


if (Hotspot.GetAtXY(player.x,player.y) == hHotspot1)


or whatever the name of the hotspot in question is.
Didn't get that impression from the help file, but I'll give that a shot too, thanks! Oh yeah, it's GetAtScreenXY.
Title: Re: Knowing when the player is over a hotspot.
Post by: discordance on Tue 27/04/2010 20:03:28
whoops, sorry :) I tend to rely way too much on autocomplete.