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.
GetRegionAt (x, y);
E.g.:
if (GetRegionAt (character[BLUE].x, character[BLUE].y) == GetRegionAt (character[EGO].x, character[EGO].y)) {
//Whatever
}
Thank you for the quick reply, it helped alot.