Author Topic: Knowing when the player is over a hotspot.  (Read 291 times)  Share 

Knowing when the player is over a hotspot.
« on: 24 Apr 2010, 22:54 »
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.
Stuart "Sslaxx" Moore.

Dualnames

  • AGS Baker
  • Dualnames worked on a game that was nominated for an AGS Award!
Re: Knowing when the player is over a hotspot.
« Reply #1 on: 24 Apr 2010, 23:24 »
I was available in 2.72, but I think it's now kind of obsolete. How about using a region instead?

Re: Knowing when the player is over a hotspot.
« Reply #2 on: 24 Apr 2010, 23:28 »
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.
« Last Edit: 24 Apr 2010, 23:30 by Sslaxx »
Stuart "Sslaxx" Moore.

discordance

  • teach him how to rock.
  • discordance worked on a game that was nominated for an AGS Award!
Re: Knowing when the player is over a hotspot.
« Reply #3 on: 25 Apr 2010, 22:17 »
You could also use

[code]
if (Hotspot.GetAtXY(player.x,player.y) == hHotspot1)
[/code]

or whatever the name of the hotspot in question is.

Re: Knowing when the player is over a hotspot.
« Reply #4 on: 25 Apr 2010, 22:34 »
You could also use

[code]
if (Hotspot.GetAtXY(player.x,player.y) == hHotspot1)
[/code]

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.
« Last Edit: 27 Apr 2010, 13:08 by Sslaxx »
Stuart "Sslaxx" Moore.

discordance

  • teach him how to rock.
  • discordance worked on a game that was nominated for an AGS Award!
Re: Knowing when the player is over a hotspot.
« Reply #5 on: 27 Apr 2010, 20:03 »
whoops, sorry :) I tend to rely way too much on autocomplete.