unit uWinPage;

interface
uses
  uMyApp, LexUtils, zglHeader, uPage, uScene, uConst, uMaterials, uGamePage;
type

  TWinPage = class(TGamePage)
    constructor Create(const Scene : TScene); override;
  end;

  TLosePage = class(TGamePage)
    constructor Create(const Scene : TScene); override;
  end;

implementation
uses
  uGame;

type
  TButtonOk = class(TGameButton)
    procedure Click; override;
  end;

  TButtonLoseOk = class(TGameButton)
    procedure Click; override;
  end;
{ TWinPage }

constructor TWinPage.Create(const Scene : TScene);
begin
  W := 512;
  H := 512;
  rX := WinW div 2;
  rY := trunc((WinH - H) / 2.5);
  Color := $FFCCCC;
  inherited Create(Scene);

  AddButton(TButtonOk.Create(0, H - 64, 'OK', Scene, Self));

  AddText('Вы выиграли', 0, 256, $000000, TEXT_HALIGN_CENTER);
end;

{ TButtonOk }

procedure TButtonOk.Click;
begin
  pPage.Enabled := false;
  with (pScene as TGame) do
    Start;

end;


{ TLosePage }

constructor TLosePage.Create(const Scene: TScene);
begin
  W := 512;
  H := 512;
  rX := WinW div 2;
  rY := trunc((WinH - H) / 2.5);
  inherited Create(Scene);
  Color := $303030;
  AddButton(TButtonLoseOk.Create(0, H - 64, 'OK', Scene, Self));

  AddText('Вы проиграли', 0, 256, $FFFFFF, TEXT_HALIGN_CENTER);
end;

{ TButtonLoseOk }

procedure TButtonLoseOk.Click;
begin
  pPage.Enabled := false;
  with (pScene as TGame) do
    Start;

end;

end.
