Delphi & Pascal (česká wiki)
Přejít na: navigace, hledání
Procedure MainScreen;
Var I: Byte;
Begin
  ClearPage(Buffer[3]);
 
  Ramecek(0,0,319,199,ColorGreenBright,Buffer[3]);
  WriteBlok(80,40,0,0,159,63,Buffer[1],Buffer[3]);
  Ramecek(78,38,241,105,ColorGreenBright,Buffer[3]);
 
  Ramecek(260,60,300,80,ColorGreenBright,Buffer[3]);
  OutText(266,66,'Bazar',Buffer[3]);
 
  WriteText(Buffer[1],160,0,5,5,1,6,3,'rekord',Buffer[3]);
  WriteNumber(Buffer[1],160,80,8,16,1,10,10,DatRec.HiScore,Buffer[3]);
 
  OutText(6,28,'JACKPOT',Buffer[3]);
  OutNumber(10,38,DatRec2.Jackpot,False,Buffer[3]);
 
  For I:=0 to 60 do WritePixel(4+I,47,ColorGreenBright,Buffer[3]);
 
  WriteText(Buffer[1],160,0,5,5,1,6,50,'hra',Buffer[3]);
  Zisky(27,50,0);
  WriteText(Buffer[1],160,0,5,5,1,6,57,'historie',Buffer[3]);
  For I:=1 to MaxHistorie do Zisky(10,57+(I*7),I);
 
  WriteText(Buffer[1],160,0,5,5,1,268,5,'f10=exit',Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,268,170,'p=penize',Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,257,180,'o=ovladani',Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,268,190,'s=servis',Buffer[3]);
 
  If Fps2s=True then Begin
                       WriteSprite(72,130,0,64,79,87,Buffer[1],Buffer[3]);
                       WriteSprite(168,130,80,64,159,87,Buffer[1],Buffer[3]);
                     End
                else Blok(72,130,247,153,ColorBlack,Buffer[3]);
 
  HideMouse;
  WaitRetrace;
  FlipPage(Buffer[3],Buffer[4]);
  ShowMouse;
End;
 
 
Procedure Main;
Var Ending: Boolean;
    I: Byte;
Begin
  Ending:=False;
  SaveLoad(False); {LOAD rekord}
  SaveLoadHistorie(False); {LOAD historie}
  MainScreen;
  Repeat
    MainScreen;
    Wait(DatRec.fpsProdleva);
 
{Enter} If ((Key[28]=True) or (EnterStiskly1=1)) then
        Begin
          While Key[28]=True do Begin End;
          MainGame;
          DatRec2.Vklad[0]:=VkladyTMP;
          DatRec2.Vyplaceno[0]:=VyplacenoTMP;
          If VyplacenoTMP>VkladyTMP then
          Begin
            If (VyplacenoTMP-VkladyTMP) > DatRec.HiScore
            then DatRec.HiScore:=VyplacenoTMP-VkladyTMP;
            SaveLoad(True);
          End;
        End;
 
{S}     If Key[31]=True then
        Begin
          While Key[31]=True do Begin End;
          Servis;
        End;
 
{O}     If Key[24]=True then
        Begin
          While Key[24]=True do Begin End;
          Ovladani;
        End;
 
{P}     If ((Key[25]=True) or (GetButton3=1) or (PeStiskly1=1)) then
        Begin
          While ((Key[25]=True) or (GetButton3=1) or (PeStiskly1=1)) do Begin End;
          Prodat;
        End;
 
{F10}   If ((Key[68]=True) or (GetButton2=1)) then Ending:=True;
 
  Until Ending=True;
  HistorieHer;
  SaveLoad(True);
  SaveLoadHistorie(True);
  If DatRec.SBEnable=True then ShutdownSB;
End;