Hi,
I am almost sure this has a simple solution, but I can't seem to find it. I have a set of classes TArena and TPlayer with a dec something like this...
Each TAIPlayer has a limited range of vision forward and to the side. Each AI decides where to move based on what he can see (i.e. are other AIs in the way?, is it close to a wall?). I know that I could send information in from the MovePlayers procedure (like an array), but I wonder if there is any way that I can have the TAIPlayer scan up into the Arena. I think that would be better because I need the AIs to scan each other for speed and direction so they can avoid one another properly.
Can a class look "upward" or do I need to find another approach?
Frank Luke
I am almost sure this has a simple solution, but I can't seem to find it. I have a set of classes TArena and TPlayer with a dec something like this...
Code:
PlayerArr = array[1..MaxPlayer] of TAIPlayer;
TArena = class(TPersistent)
private
Players: PlayerArr;
{other goodies}
public
procedure MovePlayers;
end;
Each TAIPlayer has a limited range of vision forward and to the side. Each AI decides where to move based on what he can see (i.e. are other AIs in the way?, is it close to a wall?). I know that I could send information in from the MovePlayers procedure (like an array), but I wonder if there is any way that I can have the TAIPlayer scan up into the Arena. I think that would be better because I need the AIs to scan each other for speed and direction so they can avoid one another properly.
Can a class look "upward" or do I need to find another approach?
Frank Luke