unit uBlood;

interface

uses zglHeader,
     uAdd,
     uVar;


procedure AddBlood(pos : zglTPoint2d);
procedure DrawBlood;
procedure UpdBlood;

implementation

procedure AddBlood(pos : zglTPoint2d);
var i: integer;
begin
  for I := 1 to 32 do
    if not blood[i].exist then
       begin
         blood[i].exist := true;
         blood[i].pos := pos;
         NewBlood := true;
       end;
end;

procedure DrawBlood;
var i: integer;
begin
  if NewBlood then
     begin
       texBloodOld := rt.Surface;
       rtarget_Set(rt);
       //   SSprite2d_Draw(texBloodOld, 0, 0, 800, 600, 0);
          for I := 1 to 32 do
           if blood[i].exist then
              begin
                SSprite2d_Draw(texBlood, blood[i].pos.X, blood[i].pos.Y, 32, 8, random(360), 55);
                blood[i].exist := false;
              end;
          for i := 1 to 256 do
            if enemies[i].Dead then
               begin
                 case enemies[i].eType of
                    0: ASprite2d_draw(texEn1, enemies[i].pos.X, enemies[i].pos.Y, 48, 96, enemies[i].ang + 90, enemies[i].frame);
                    1: ASprite2d_draw(texEn2, enemies[i].pos.X, enemies[i].pos.Y, 48, 96, enemies[i].ang + 90, enemies[i].frame);
                 end;
                 enemies[i].Dead := false;
                 enemies[i].exist:= false;
               end;
            
          newblood:= false;
       rtarget_Set(nil);
     end;
  SSprite2d_Draw(rt.Surface, 0, 0, 800, 600, 0, 255);
end;

procedure UpdBlood;
begin

end;
end.
