Hiya, here's a little OO challenge for you:
The hunter stores a reference to the prey with self.pray = p (if looping through preys and choosing one).
It does this so the hunter can access the prey objects data with a pointer to it (or is this a reference to it?)
Within the hunterType update code, I go: If self.prey = Null Then find new prey.
However even when I remove the prey object, it is never null when the hunter checks his prey field? How do I detect when it no longer exists?
Field preyType Field x,y:Int End Type Type hunterType Field x,y:Int Field prey:preyType End Type
The hunter stores a reference to the prey with self.pray = p (if looping through preys and choosing one).
It does this so the hunter can access the prey objects data with a pointer to it (or is this a reference to it?)
Within the hunterType update code, I go: If self.prey = Null Then find new prey.
However even when I remove the prey object, it is never null when the hunter checks his prey field? How do I detect when it no longer exists?