unit uInit;

interface
uses
  Omega, OmegaPNG, MikModEng, load_xm;

var
  FPS: integer;
  procedure AllInit;

implementation
uses
  uGame, uMenu;

// Процедура инициализации
procedure AllInit;
var
i, j, x, y: integer;
begin
  big_gear := Tex_LoadPNGFromFile( 'data\textures\big_gear.png', -1, TEX_DEFAULT_2D );
  Cursors[0] := Tex_LoadPNGFromFile( 'data\textures\cursor.png', -1, TEX_DEFAULT_2D );
  Cursor_Color := Tex_LoadPNGFromFile( 'data\textures\cursor2.png', -1, TEX_DEFAULT_2D );
  Cursor := Cursors[0];
  Black := Tex_LoadPNGFromFile( 'data\textures\screens\black.png', -1, TEX_DEFAULT_2D );
  Black_Menu.tex := Black;
  Back := Tex_LoadPNGFromFile( 'data\textures\screens\back.png', -1, TEX_DEFAULT_2D );
  Title := Tex_LoadPNGFromFile( 'data\textures\title.png', -1, TEX_DEFAULT_2D );
  Logo := Tex_LoadPNGFromFile( 'data\textures\igdc.png', -1, TEX_DEFAULT_2D );
  BrightTex[0] := Black;
  BrightTex[1] := Tex_LoadPNGFromFile( 'data\textures\screens\white.png', -1, TEX_DEFAULT_2D );
  logo_count := 750;
  logo_alpha := 255;
  Panel := Tex_LoadPNGFromFile( 'data\textures\panels\game_panel.png', -1, TEX_DEFAULT_2D );
  labelpanels[0] := Tex_LoadPNGFromFile( 'data\textures\panels\label_panel.png', -1, TEX_DEFAULT_2D );
  labelpanels[1] := labelpanels[0];
  labelpanels[2] := labelpanels[0];
  labelpanels[3] := Tex_LoadPNGFromFile( 'data\textures\panels\figure_panel.png', -1, TEX_DEFAULT_2D );
  Message_panel := Tex_LoadPNGFromFile( 'data\textures\panels\message_panel.png', -1, TEX_DEFAULT_2D );
  Black_Message := black;
  Black_pause := black;
  // Fonts
  Font[0] := Text_LoadFontFromFile ( 'data\fonts\free.bmp', 'data\fonts\font1\config.ofi', $FFFFFF, TEX_DEFAULT_2D );
  Font[0].Texture := Tex_LoadPNGFromFile( 'data\fonts\font1\texture.png', -1, TEX_DEFAULT_2D );
  Font[1] := Text_LoadFontFromFile ( 'data\fonts\free.bmp', 'data\fonts\font2\config.ofi', $FFFFFF, TEX_DEFAULT_2D );
  Font[1].Texture := Tex_LoadPNGFromFile( 'data\fonts\font2\texture.png', -1, TEX_DEFAULT_2D );
  // Balls
  Ball := Tex_LoadPNGFromFile( 'data\textures\gear.png', -1, TEX_DEFAULT_2D );
  for i := 0 to 14 do
  begin
    Balls[i].Tex := Ball;
    Balls[i].x := Random(700);
    Balls[i].y := Random(500);
    Balls[i].W := 1;
    Balls[i].H := 1;
    Balls[i].Alpha := 255;
    Balls[i].Speed := Random(3) + 1;
  end;
  for i := 0 to 5 do
  begin
    Balls2[i].Tex := Ball;
  end;
  // Кнопки
  // NewGame
  NewGame.rect.X := 340;
  NewGame.rect.Y := 235;
  NewGame.rect.Width := 120;
  NewGame.rect.Height := 50;
  NewGame.play := False;
  NewGame.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\new_game.png', -1, TEX_DEFAULT_2D );
  NewGame.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\new_game2.png', -1, TEX_DEFAULT_2D );
  // TopScores
  TopScores.rect.X := 340;
  TopScores.rect.Y := 295;
  TopScores.rect.Width := 120;
  TopScores.rect.Height := 50;
  TopScores.play := False;
  TopScores.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\top_scores.png', -1, TEX_DEFAULT_2D );
  TopScores.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\top_scores2.png', -1, TEX_DEFAULT_2D );
  // Options
  Options.rect.X := 340;
  Options.rect.Y := 355;
  Options.rect.Width := 120;
  Options.rect.Height := 50;
  Options.play := False;
  Options.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\options.png', -1, TEX_DEFAULT_2D );
  Options.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\options2.png', -1, TEX_DEFAULT_2D );
  // About
  About.rect.X := 340;
  About.rect.Y := 415;
  About.rect.Width := 120;
  About.rect.Height := 50;
  About.play := False;
  About.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\info.png', -1, TEX_DEFAULT_2D );
  About.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\info2.png', -1, TEX_DEFAULT_2D );
  // Quit
  Quit.rect.X := 340;
  Quit.rect.Y := 475;
  Quit.rect.Width := 120;
  Quit.rect.Height := 50;
  Quit.play := False;
  Quit.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\quit.png', -1, TEX_DEFAULT_2D );
  Quit.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\quit2.png', -1, TEX_DEFAULT_2D );
  // Resume
  Resume.rect.X := 340;
  Resume.rect.Y := 218;
  Resume.rect.Width := 120;
  Resume.rect.Height := 50;
  Resume.play := False;
  Resume.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\resume.png', -1, TEX_DEFAULT_2D );
  Resume.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\resume2.png', -1, TEX_DEFAULT_2D );
  // Restart
  Restart.rect.X := 340;
  Restart.rect.Y := 278;
  Restart.rect.Width := 120;
  Restart.rect.Height := 50;
  Restart.play := False;
  Restart.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\restart.png', -1, TEX_DEFAULT_2D );
  Restart.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\restart2.png', -1, TEX_DEFAULT_2D );
  // Tomenu
  Tomenu.rect.X := 340;
  Tomenu.rect.Y := 338;
  Tomenu.rect.Width := 120;
  Tomenu.rect.Height := 50;
  Tomenu.play := False;
  Tomenu.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\to_menu.png', -1, TEX_DEFAULT_2D );
  Tomenu.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\to_menu2.png', -1, TEX_DEFAULT_2D );
  // Back
  RBack.rect.X := 340;
  RBack.rect.Y := 475;
  RBack.rect.Width := 120;
  RBack.rect.Height := 50;
  RBack.play := False;
  RBack.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\back.png', -1, TEX_DEFAULT_2D );
  RBack.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\back2.png', -1, TEX_DEFAULT_2D );
  // Pause
  Pause.rect.X := 70;
  Pause.rect.Y := 515;
  Pause.rect.Width := 120;
  Pause.rect.Height := 50;
  Pause.play := False;
  Pause.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\pause.png', -1, TEX_DEFAULT_2D );
  Pause.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\pause2.png', -1, TEX_DEFAULT_2D );
  // yes
  yes.rect.X := 260;
  yes.rect.Y := 330;
  yes.rect.Width := 120;
  yes.rect.Height := 50;
  yes.play := False;
  yes.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\yes.png', -1, TEX_DEFAULT_2D );
  yes.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\yes2.png', -1, TEX_DEFAULT_2D );
  // no
  no.rect.X := 420;
  no.rect.Y := 330;
  no.rect.Width := 120;
  no.rect.Height := 50;
  no.play := False;
  no.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\no.png', -1, TEX_DEFAULT_2D );
  no.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\no2.png', -1, TEX_DEFAULT_2D );
  // nextlevel
  NextLevel.rect.X := 340;
  NextLevel.rect.Y := 330;
  NextLevel.rect.Width := 120;
  NextLevel.rect.Height := 50;
  NextLevel.play := False;
  NextLevel.tex[0] := Tex_LoadPNGFromFile( 'data\textures\buttons\next.png', -1, TEX_DEFAULT_2D );
  NextLevel.tex[1] := Tex_LoadPNGFromFile( 'data\textures\buttons\next2.png', -1, TEX_DEFAULT_2D );
  // BigSounds button
  BigSounds.rect.X := 256;
  BigSounds.rect.Y := 250;
  BigSounds.rect.Width := 110;
  BigSounds.rect.Height := 120;
  BigSounds.play := False;
  BigSounds.tex[0] := Tex_LoadPNGFromFile( 'data\textures\big_buttons\sounds.png', -1, TEX_DEFAULT_2D );
  BigSounds.tex[1] := Tex_LoadPNGFromFile( 'data\textures\big_buttons\sounds2.png', -1, TEX_DEFAULT_2D );
  // BigOther button
  BigOther.rect.X := 425;
  BigOther.rect.Y := 250;
  BigOther.rect.Width := 110;
  BigOther.rect.Height := 120;
  BigOther.play := False;
  BigOther.tex[0] := Tex_LoadPNGFromFile( 'data\textures\big_buttons\other.png', -1, TEX_DEFAULT_2D );
  BigOther.tex[1] := Tex_LoadPNGFromFile( 'data\textures\big_buttons\other2.png', -1, TEX_DEFAULT_2D );
  // BigAbout button
  BigAbout.rect.X := 256;
  BigAbout.rect.Y := 250;
  BigAbout.rect.Width := 110;
  BigAbout.rect.Height := 120;
  BigAbout.play := False;
  BigAbout.tex[0] := Tex_LoadPNGFromFile( 'data\textures\big_buttons\about.png', -1, TEX_DEFAULT_2D );
  BigAbout.tex[1] := Tex_LoadPNGFromFile( 'data\textures\big_buttons\about2.png', -1, TEX_DEFAULT_2D );
  // BigHelp button
  BigHelp.rect.X := 425;
  BigHelp.rect.Y := 250;
  BigHelp.rect.Width := 110;
  BigHelp.rect.Height := 120;
  BigHelp.play := False;
  BigHelp.tex[0] := Tex_LoadPNGFromFile( 'data\textures\big_buttons\help.png', -1, TEX_DEFAULT_2D );
  BigHelp.tex[1] := Tex_LoadPNGFromFile( 'data\textures\big_buttons\help2.png', -1, TEX_DEFAULT_2D );
  // Music_Bar
  Music_Bar.bar_tex := Tex_LoadPNGFromFile( 'data\textures\scroll_bar\scroll_bar.png', -1, TEX_DEFAULT_2D );
  Music_Bar.scrollbutton_tex[0] := Tex_LoadPNGFromFile( 'data\textures\scroll_bar\scroll_button.png', -1, TEX_DEFAULT_2D );
  Music_Bar.scrollbutton_tex[1] := Tex_LoadPNGFromFile( 'data\textures\scroll_bar\scroll_button2.png', -1, TEX_DEFAULT_2D );
  Music_Bar.rect.Y := 231;
  Music_Bar.rect.Width := 24;
  Music_Bar.rect.Height := 36;
  // Sounds_Bar
  Sounds_Bar.bar_tex := Music_Bar.bar_tex;
  Sounds_Bar.scrollbutton_tex[0] := Music_Bar.scrollbutton_tex[0];
  Sounds_Bar.scrollbutton_tex[1] := Music_Bar.scrollbutton_tex[1];
  Sounds_Bar.rect.Y := 321;
  Sounds_Bar.rect.Width := 24;
  Sounds_Bar.rect.Height := 36;
  // Music_Bar
  Brightness_Bar.bar_tex := Music_Bar.bar_tex;
  Brightness_Bar.scrollbutton_tex[0] := Music_Bar.scrollbutton_tex[0];
  Brightness_Bar.scrollbutton_tex[1] := Music_Bar.scrollbutton_tex[1];
  Brightness_Bar.rect.Y := 231;
  Brightness_Bar.rect.Width := 24;
  Brightness_Bar.rect.Height := 36;
  // MuteSounds_Check
  MuteSounds_Check.buttons[0] := Tex_LoadPNGFromFile( 'data\textures\check\button.png', -1, TEX_DEFAULT_2D );
  MuteSounds_Check.buttons[1] := Tex_LoadPNGFromFile( 'data\textures\check\button2.png', -1, TEX_DEFAULT_2D );
  MuteSounds_Check.check_tex := Tex_LoadPNGFromFile( 'data\textures\check\check.png', -1, TEX_DEFAULT_2D );
  MuteSounds_Check.rect.X := 235;
  MuteSounds_Check.rect.Y := 380;
  MuteSounds_Check.rect.Width := 36;
  MuteSounds_Check.rect.Height := 36;
  // ShowGears_Check
  ShowGears_Check.buttons[0] := MuteSounds_Check.buttons[0];
  ShowGears_Check.buttons[1] := MuteSounds_Check.buttons[1];
  ShowGears_Check.check_tex := MuteSounds_Check.check_tex;
  ShowGears_Check.rect.X := 235;
  ShowGears_Check.rect.Y := 335;
  ShowGears_Check.rect.Width := 36;
  ShowGears_Check.rect.Height := 36;
  // Fullscreen_Check
  Fullscreen_Check.buttons[0] := MuteSounds_Check.buttons[0];
  Fullscreen_Check.buttons[1] := MuteSounds_Check.buttons[1];
  Fullscreen_Check.check_tex := MuteSounds_Check.check_tex;
  Fullscreen_Check.rect.X := 235;
  Fullscreen_Check.rect.Y := 385;
  Fullscreen_Check.rect.Width := 36;
  Fullscreen_Check.rect.Height := 36;
  // ShowFPS_Check
  ShowFPS_Check.buttons[0] := MuteSounds_Check.buttons[0];
  ShowFPS_Check.buttons[1] := MuteSounds_Check.buttons[1];
  ShowFPS_Check.check_tex := MuteSounds_Check.check_tex;
  ShowFPS_Check.rect.X := 235;
  ShowFPS_Check.rect.Y := 285;
  ShowFPS_Check.rect.Width := 36;
  ShowFPS_Check.rect.Height := 36;
  // Загружаем настройик из INI файла
  Nick := PChar(INI_ReadKeyStr( 'Other', 'Nickname' ));
  Music_Bar.move_x := INI_ReadKeyInt( 'SrollBars', 'Music' );
  Music_Bar.rect.X := Music_Bar.move_x + 2;
  Sounds_Bar.move_x := INI_ReadKeyInt( 'SrollBars', 'Sounds' );
  Sounds_Bar.rect.X := Sounds_Bar.move_x + 2;
  Brightness_Bar.move_x := INI_ReadKeyInt( 'SrollBars', 'Brightness' );
  Brightness_Bar.rect.X := Brightness_Bar.move_x + 2;
  Music_Volume := INI_ReadKeyInt( 'Volume', 'Music' );
  Sounds_Volume := INI_ReadKeyInt( 'Volume', 'Sounds' );
  Brightness := INI_ReadKeyInt( 'Other', 'Brightness' );
  {MuteSounds_Check.Str := PChar(INI_ReadKeyStr( 'Settings', 'Mute_Sounds' ));
  if MuteSounds_Check.Str = 'True' then MuteSounds_Check.check := true;
  if MuteSounds_Check.Str = 'False' then MuteSounds_Check.check := false;}
  MuteSounds_Check.check := StrToBool( String(INI_ReadKeyStr( 'Volume', 'Mute' )) );
  ShowGears_Check.check := StrToBool( String(INI_ReadKeyStr( 'Show', 'Gears' )) );
  ShowFPS_Check.check := StrToBool( String(INI_ReadKeyStr( 'Show', 'FPS' )) );
  Show_greed := StrToBool( String(INI_ReadKeyStr( 'Show', 'Greed' )) );
  ShowGears := Showgears_Check.check;
  ShowFPS := ShowFPS_Check.check;
  Fullscreen_check.check := Fullscreen;
  OE_SetWndName('Pipes tetris');
  // preview figures
  preview[1] := Tex_LoadPNGFromFile( 'data\figures\preview\figure1.png', -1, TEX_DEFAULT_2D );
  preview[2] := Tex_LoadPNGFromFile( 'data\figures\preview\figure2.png', -1, TEX_DEFAULT_2D );
  preview[3] := Tex_LoadPNGFromFile( 'data\figures\preview\figure3.png', -1, TEX_DEFAULT_2D );
  preview[4] := Tex_LoadPNGFromFile( 'data\figures\preview\figure4.png', -1, TEX_DEFAULT_2D );
  preview[5] := Tex_LoadPNGFromFile( 'data\figures\preview\figure5.png', -1, TEX_DEFAULT_2D );
  preview[6] := Tex_LoadPNGFromFile( 'data\figures\preview\figure6.png', -1, TEX_DEFAULT_2D );
  preview[7] := Tex_LoadPNGFromFile( 'data\figures\preview\figure7.png', -1, TEX_DEFAULT_2D );
  // Загружаем фигуры
  Open( 1 );
  Open( 2 );
  Open( 3 );
  Open( 4 );
  Open( 5 );
  Open( 6 );
  Open( 7 );
  // Blocks
  Blocks[2] := Tex_LoadPNGFromFile( 'data\textures\pipes\full\pipe1.png', -1, TEX_DEFAULT_2D );
  Blocks[3] := Tex_LoadPNGFromFile( 'data\textures\pipes\full\pipe2.png', -1, TEX_DEFAULT_2D );
  Blocks[4] := Tex_LoadPNGFromFile( 'data\textures\pipes\full\pipe3.png', -1, TEX_DEFAULT_2D );
  Blocks[5] := Tex_LoadPNGFromFile( 'data\textures\pipes\full\pipe4.png', -1, TEX_DEFAULT_2D );
  Blocks[6] := Tex_LoadPNGFromFile( 'data\textures\pipes\full\pipe5.png', -1, TEX_DEFAULT_2D );
  Blocks[7] := Tex_LoadPNGFromFile( 'data\textures\pipes\full\pipe6.png', -1, TEX_DEFAULT_2D );
  Blocks[8] := Tex_LoadPNGFromFile( 'data\textures\pipes\full\pipe7.png', -1, TEX_DEFAULT_2D );
  Blocks[9] := Tex_LoadPNGFromFile( 'data\textures\pipes\full\pipe8.png', -1, TEX_DEFAULT_2D );
  Blocks[10] := Tex_LoadPNGFromFile( 'data\textures\pipes\full\pipe9.png', -1, TEX_DEFAULT_2D );
  Blocks[11] := Tex_LoadPNGFromFile( 'data\textures\pipes\full\pipe10.png', -1, TEX_DEFAULT_2D );
  Blocks[12] := Tex_LoadPNGFromFile( 'data\textures\pipes\full\pipe11.png', -1, TEX_DEFAULT_2D );
  // Blocks2
  Blocks2[2] := Tex_LoadPNGFromFile( 'data\textures\pipes\empty\pipe1.png', -1, TEX_DEFAULT_2D );
  Blocks2[3] := Tex_LoadPNGFromFile( 'data\textures\pipes\empty\pipe2.png', -1, TEX_DEFAULT_2D );
  Blocks2[4] := Tex_LoadPNGFromFile( 'data\textures\pipes\empty\pipe3.png', -1, TEX_DEFAULT_2D );
  Blocks2[5] := Tex_LoadPNGFromFile( 'data\textures\pipes\empty\pipe4.png', -1, TEX_DEFAULT_2D );
  Blocks2[6] := Tex_LoadPNGFromFile( 'data\textures\pipes\empty\pipe5.png', -1, TEX_DEFAULT_2D );
  Blocks2[7] := Tex_LoadPNGFromFile( 'data\textures\pipes\empty\pipe6.png', -1, TEX_DEFAULT_2D );
  Blocks2[8] := Tex_LoadPNGFromFile( 'data\textures\pipes\empty\pipe7.png', -1, TEX_DEFAULT_2D );
  Blocks2[9] := Tex_LoadPNGFromFile( 'data\textures\pipes\empty\pipe8.png', -1, TEX_DEFAULT_2D );
  Blocks2[10] := Tex_LoadPNGFromFile( 'data\textures\pipes\empty\pipe9.png', -1, TEX_DEFAULT_2D );
  Blocks2[11] := Tex_LoadPNGFromFile( 'data\textures\pipes\empty\pipe10.png', -1, TEX_DEFAULT_2D );
  Blocks2[12] := Tex_LoadPNGFromFile( 'data\textures\pipes\empty\pipe11.png', -1, TEX_DEFAULT_2D );
  // Игровое поле
  for i := 0 to 20 do
  for j := 0 to 17 do
  y := -30;
  for i := 0 to 19 do
  begin
    y := y + 30;
    x := 250;
    for j := 0 to 17 do
    begin
      // 1
      greed[i,j].tex := Blocks[12];
      greed[i,j].byte := 1;
      greed[i,j].rect.X := x;
      greed[i,j].rect.Y := y;
      greed[i,j].rect.Width := 30;
      greed[i,j].rect.Height := 30;
      // 2
      greed2[i,j].tex := black;
      greed2[i,j].byte := 2;
      greed2[i,j].rect.X := x;
      greed2[i,j].rect.Y := y;
      greed2[i,j].rect.Width := 30;
      greed2[i,j].rect.Height := 30;
      x := x + 30;
    end;
  end;
  // text about =)
  strings[0].text := 'Pipes Tetris';
  strings[1].text := 'Special for IGDC';
  strings[2].text := 'Code by Gluk';
  strings[3].text := 'Omega Engine';
  strings[4].text := 'by Andru';
  strings[5].text := 'Music by';
  strings[6].text := 'Maniacs of noise';
  strings[7].text := 'Thanks to';
  strings[8].text := 'Darthman';
  strings[9].text := 'for IGDC';
  strings[10].text := 'grouzd)ev';
  strings[11].text := 'for contests';
  strings[12].text := 'Adobe';
  strings[13].text := 'for Photoshop';
  strings[14].text := 'Borland';
  strings[15].text := 'for Delphi';
  strings[16].text := 'and Nullsoft';
  strings[17].text := 'for Winamp =)';
  // text help =)
  strings2[0].text := 'Build a';
  strings2[1].text := 'pipeline and';
  strings2[2].text := 'collect points';
  strings2[3].text := 'controls:';
  strings2[4].text := 'left arrow -';
  strings2[5].text := 'move left';
  strings2[6].text := 'right arrow -';
  strings2[7].text := 'move right';
  strings2[8].text := 'up arrow -';
  strings2[9].text := 'rotate figure';
  strings2[10].text := 'space -';
  strings2[11].text := 'set figure';
  strings2[12].text := 'g - show\';
  strings2[13].text := 'hide greed';
  strings2[14].text := 'escape -';
  strings2[15].text := 'pause game';
  // x
  for i := 0 to 17 do
  strings[i].x := Round(Text_GetWidth( Font[0], PChar(String(strings[i].text)), 1, 1 ));
  // x2
  for i := 0 to 15 do
  strings2[i].x := Round(Text_GetWidth( Font[0], PChar(String(strings2[i].text)), 1, 1 ));
  // Sounds
  MikMod.Load('data\music\music.xm');
  MikMod.loop := true;
  MikMod.Play;
  if MuteSounds_Check.check then MikMod.Volume := 0 else MikMod.Volume := Music_Volume;
  Snd_Init;
  rotate_snd := Snd_LoadFromFile('data\sounds\rotate.wav', 2);
  move_snd := Snd_LoadFromFile('data\sounds\move.wav', 2);
  down_snd := Snd_LoadFromFile('data\sounds\down.wav', 2);
  check_snd := Snd_LoadFromFile('data\sounds\check.wav', 2);
  button_snd := Snd_LoadFromFile('data\sounds\button.wav', 2);
  click_snd := Snd_LoadFromFile('data\sounds\click.wav', 2);
  pipe_snd := Snd_LoadFromFile('data\sounds\pipe.wav', 2);
  Sounds_Volume2 := Round( (((Sounds_Bar.move_X - 236) / 3) / 2) + 50  );
  if fullscreen then OE_ChangeScreenOptions( 800, 600, 32, 0, TRUE, FALSE )
  else OE_ChangeScreenOptions( 800, 600, 32, 0, FALSE, FALSE );
  Key_BeginReadText(PChar(string(nick)));
  Pr2D_LineWidth(1);
  Save_Nick := Nick;
  load_top;
  {top_scores[0].nick := 'Tester';
  top_scores[1].nick := 'Tester';
  top_scores[2].nick := 'Tester';
  top_scores[3].nick := 'Tester';
  top_scores[4].nick := 'Tester';
  top_scores[0].points := 50000;
  top_scores[1].points := 40000;
  top_scores[2].points := 30000;
  top_scores[3].points := 20000;
  top_scores[4].points := 10000;}
end;

end.
