Why did you make it end the game when it dies?
Also, if you applied the code directly to an actor, you could replace "sentryActor" with "self" right?
If so:
Code:
if not self.target then
for bullet in MovableMan.Particles do
local diff = math.sqrt(math.pow((bullet.Pos.X - self.Pos.X),2) + math.pow((bullet.Pos.Y - self.Pos.Y),2))
if diff < 100 and bullet.ID ~= self.ID and bullet.HitsMOs == 1 then
self.target = bullet;
end
end
end
if MovableMan:IsParticle(self.target) then
if SceneMan:ShortestDistance(self.Pos,self.target.Pos) < 100 then
self:SetAimAngle(math.atan2(self.target.Pos.Y-self.Pos.Y,self.target.Pos.Y-self.Pos.Y));
end
end
Why not for Auto-Aiming Shield?
That code there can only focus on one bullet, until that bullet is dead, then it switches to the next one.
I guess I could fix it later, but I'm just throwing the idea out there now.