Checking Regions for NPCs

Started by TheJBurger, Mon 25/04/2005 00:16:41

Previous topic - Next topic

TheJBurger

I'm having a problem in a game I'm making.

The game is in top view of a building with numerous rooms. Each room is marked by a different region. There are two characters, EGO and BLUE. EGO is you of course, and BLUE is the enemy.

I want it so that every time EGO is on the same region as BLUE, BLUE starts following EGO. The problem is, I don't know how to check if BLUE is on the same region as EGO.

Any help is appreciated.

Ashen

GetRegionAt (x, y);

E.g.:
Code: ags

if (GetRegionAt (character[BLUE].x, character[BLUE].y) == GetRegionAt (character[EGO].x, character[EGO].y)) {
  //Whatever
}
I know what you're thinking ... Don't think that.

TheJBurger

Thank you for the quick reply, it helped alot.

SMF spam blocked by CleanTalk