unit var_const;

{$mode delphi}

interface

uses
  Classes, SysUtils,core_unit,cursor_scene,sceneUnit,zglHeader,zglGUI;
const      LevSize=1024;
           Shell_Normal = 0;
           Shell_Rocket = 1;
           Shell_Granade = 2;


           Unit_Soldier = 0;
           Unit_Rocketman = 1;
           Unit_Tank = 2;
           Unit_Medic = 3;
           Unit_Capitan = 4;
           Unit_Sniper = 5;
type
    TShell = record
    pos: zglTPoint2D;
    type_: byte;
    direction: single;
    speed: single;
  end;

var Game:TCore;
    cursor:TScene;
    GameScene:TScene;
     MenuScene:TScene;

    {Textures}
      floor:zglPTexture;
      walltex_0:zglPTexture;
      walltex_1:zglPTexture;
      soldiertex:zglPtexture;
      rocketmantex:zglPtexture;
      tanktex:zglPtexture;
      medictex:zglPtexture;
      Capitantex:zglPtexture;
      SniperTex:zglPTexture;

      shellTex_0:zglPTexture;

      tracertex:zglPTexture;

      sentry_body_tex:zglpTexture;
      sentry_head_tex_0:zglPTexture;
      sentry_head_tex_1:zglPTexture;
      sentry_head_tex_2:zglPTexture;

      bgTex:zglPTexture;
    {Textures}
    fntMain:zglPFont;  //fint
    gSkin: zglTGuiSkin; //Skin
    {emitters\pengine}
    particles:zglTPengine2d;
    particles1:zglTPengine2d;

    teleportEmitter:zglPEmitter2d;
    tracerEmitter:zglPEmitter2d;
    shellTracerEmitter:zglPEmitter2d;
    //shellTracerMedicEmitter:zglPEmitter2d;
    BoomEmitter:zglPEmitter2d;
    healEmitter:zglPEmitter2d;

    bgEmitter:zglPEmitter2d;
    {end}
    {music/sfx}
      bgmusic:zglPSound;
      blastersound,stepSound,teleportSound,
      BoomSound,missSound,SelectSound,
      healSound,RepairSound:zglPSound;
    {music/sfx}

    bestScore:integer;

    function randomBool:boolean;
    function CalcX2D( const X : Single ) : Single;
    function CalcY2D( const Y : Single ) : Single;
implementation
       function randomBool:boolean;
        var k:integer;
        begin
          k:=random(2);
          if k=0 then result:=false else result:=true;
        end;
       function CalcX2D( const X : Single ) : Single;
       begin
         Result := ( X - Game.GetScreenW() / 2 ) * ( 1 / Game.GetScreenW() / 2 );
       end;

       function CalcY2D( const Y : Single ) : Single;
       begin
         Result := ( Y - Game.GetScreenH() / 2 ) * ( 1 / Game.GetScreenH() / 2 );
       end;
end.

