unit eEnemy;

interface

uses zglHeader,
     uVar;

procedure EnRender;
procedure EnUpdate;

implementation

procedure EnRender;
var i: integer;
begin
  for I := 1 to 256 do
    if enemies[i].exist then
       case enemies[i].eType of
         0: ASprite2d_draw(texEn1, enemies[i].pos.X, enemies[i].pos.Y, 32, 64, enemies[i].ang, enemies[i].frame);
       end;
end;

procedure EnUpdate;
var i: integer;
begin
  inc(fCounter);
  if fCounter > 10 then fCounter := 0;  
  for I := 1 to 256 do
    if enemies[i].exist then
       case enemies[i].eType of
         0: begin
              if fCounter = 5 then inc(enemies[i].frame);
              if enemies[i].frame > 16 then enemies[i].frame := 1;
            end;
       end;
end;

end.
