Is there a quick and simple way of checking a range of pixels for the GetHotSpotAt, rather than just a single x and y coordinate?
To say, I'm checking the hotspots at cEgo's y, but I want to check for the hotspots anywhere between cEgo.y+10 to cEgo.y-10, without having to repeat the If statement 20 times.
It depends on what you're trying to accomplish really but no, there is no other way except calling the function. However, it might be possible to optimize the number of times you need to call it though.
The basic code would be this:
int y = cEgo.y - 9;
while (y < 10)
{
if (HotSpot.GetAtScreenXY(cEgo.x - Room.GetViewportX(), y - Room.GetViewportY()) == SOMETHING)
doSomething();
y++;
}
Okay. I had a feeling it'd be something like that, but I'd managed to forget the syntax for the whole "while" thing.
It's supposed to be:
while (y < cEgo.y + 10)
and
GetViewportX(), GetViewportY()
Yeah, I got the right coding for those parts already, it was more the "while" part that I'd forgotten how to do.
now I've just got to tweak the exact range it checks. Thanks!