unit u_Init;

interface
uses
  Omega;

const
MAX_W = 31;
MAX_H = 23;

var
  Mem : Pmemory;
  procedure AllInit;
  
implementation
uses
  u_Game, u_Menu;

// Процедура инициализации
procedure AllInit;
var
i, j, x, y: integer;
begin
  Font := Text_LoadFontFromFile ( 'Textures\font.gif', 'font.ofi', $040204, TEX_DEFAULT_2D );
  cur := Tex_LoadFromFile( 'Textures\cur.gif', $FCFEFC, TEX_DEFAULT_2D );
  splash := Tex_LoadFromFile( 'Textures\splash.jpg', $FCFEFC, TEX_DEFAULT_2D );
  weapon2 := Tex_LoadFromFile( 'Textures\weapon2.gif', $FCFEFC, TEX_DEFAULT_2D );
  tile1 := Tex_LoadFromFile( 'Textures\Tiles\tile1.gif', $FCFEFC, TEX_DEFAULT_2D );
  tile2 := Tex_LoadFromFile( 'Textures\Tiles\tile2.gif', $111111, TEX_DEFAULT_2D );
  player.Texture := Tex_LoadFromFile( 'Textures\Players\player1.gif', $FCFEFC, TEX_DEFAULT_2D );
  ttenemy := Tex_LoadFromFile( 'Textures\Players\enemy.gif', $FFFFFF, TEX_DEFAULT_2D );
  player.Legs[1] := Tex_LoadFromFile( 'Textures\Legs\legs1.gif', $FFFFFF, TEX_DEFAULT_2D );
  player.Legs[2] := Tex_LoadFromFile( 'Textures\Legs\legs2.gif', $FFFFFF, TEX_DEFAULT_2D );
  player.Legs[3] := Tex_LoadFromFile( 'Textures\Legs\legs3.gif', $FFFFFF, TEX_DEFAULT_2D );
  player.Legs[4] := Tex_LoadFromFile( 'Textures\Legs\legs4.gif', $FFFFFF, TEX_DEFAULT_2D );
  player.Legs[5] := Tex_LoadFromFile( 'Textures\Legs\legs5.gif', $FFFFFF, TEX_DEFAULT_2D );
  player.Legs[6] := Tex_LoadFromFile( 'Textures\Legs\legs6.gif', $FFFFFF, TEX_DEFAULT_2D );
  bullets[0].Texture := Tex_LoadFromFile( 'Textures\bullet.gif', $FCFEFC, TEX_DEFAULT_2D );
  glock := Tex_LoadFromFile( 'Textures\glock.gif', $FCFEFC, TEX_DEFAULT_2D );
  player.Main_Legs := player.legs[1];
  Camera := Cam2D_Create;
  Cam2D_Set( Camera );
  n := 1;
  new_game.alpha := 180;
  new_game.Rect.X := 10;
  new_game.Rect.Y := 400;
  new_game.Rect.Width := 65;
  new_game.Rect.Height := 15;
  quit.Alpha := 180;
  quit.Rect.X := 10;
  quit.Rect.Y := 425;
  quit.Rect.Width := 63;
  quit.Rect.Height := 15;
  player.X := 500;
  player.y := 500;
  weapon := glock;
  for i := 0 to 49 do
  begin
    enemys[i].X := Random(1160);
    enemys[i].Y := Random(1160);
    enemys[i].Texture := ttenemy;
    enemys[i].damage := 5;
    stones[i].Texture := tile1;
    stones[i].X := Random(1160);
    stones[i].Y := Random(1160);
  end;
end;

end.
