2011-09-07 17:58:54 +00:00
|
|
|
unit gameplayform;
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
2011-09-14 00:35:25 +00:00
|
|
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
2011-09-15 14:14:50 +00:00
|
|
|
ExtCtrls,
|
|
|
|
// TappyTux
|
2011-10-24 19:51:13 +00:00
|
|
|
{GameData,} tappydrawer, tappymodules;
|
2011-09-07 17:58:54 +00:00
|
|
|
|
|
|
|
type
|
2011-09-14 00:35:25 +00:00
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
{ TformTappyTuxGame }
|
2011-09-14 00:35:25 +00:00
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
TformTappyTuxGame = class(TForm)
|
2011-09-14 00:35:25 +00:00
|
|
|
btnExit: TButton;
|
2011-10-24 23:09:39 +00:00
|
|
|
Answer: TEdit;
|
2011-10-25 14:29:52 +00:00
|
|
|
No: TButton;
|
|
|
|
Yes: TButton;
|
2011-10-24 23:09:39 +00:00
|
|
|
Question2: TEdit;
|
|
|
|
Question4: TEdit;
|
|
|
|
Question3: TEdit;
|
|
|
|
Question5: TEdit;
|
|
|
|
Level: TEdit;
|
|
|
|
Score: TEdit;
|
|
|
|
Lives: TEdit;
|
|
|
|
Question1: TEdit;
|
|
|
|
LabelLevels: TLabel;
|
|
|
|
LabelScore: TLabel;
|
|
|
|
LabelLives: TLabel;
|
|
|
|
Test: TMemo;
|
2011-10-25 14:29:52 +00:00
|
|
|
GameOver: TToggleBox;
|
2011-09-14 00:35:25 +00:00
|
|
|
procedure btnExitClick(Sender: TObject);
|
2011-10-24 23:09:39 +00:00
|
|
|
procedure AnswerKeyPress(Sender: TObject; var Key: char);
|
2011-09-14 00:35:25 +00:00
|
|
|
procedure FormCreate(Sender: TObject);
|
2011-10-25 14:29:52 +00:00
|
|
|
procedure NoClick(Sender: TObject);
|
2011-10-25 22:24:00 +00:00
|
|
|
procedure TestChange(Sender: TObject);
|
2011-10-25 14:29:52 +00:00
|
|
|
procedure YesClick(Sender: TObject);
|
2011-10-24 23:09:39 +00:00
|
|
|
|
2011-09-07 17:58:54 +00:00
|
|
|
private
|
|
|
|
{ private declarations }
|
|
|
|
public
|
|
|
|
{ public declarations }
|
2011-09-14 00:35:25 +00:00
|
|
|
backgroundImage: TJpegImage;
|
2011-09-15 14:14:50 +00:00
|
|
|
end;
|
2011-09-07 17:58:54 +00:00
|
|
|
|
|
|
|
var
|
2011-09-15 14:14:50 +00:00
|
|
|
formTappyTuxGame: TformTappyTuxGame;
|
2011-09-07 17:58:54 +00:00
|
|
|
|
|
|
|
implementation
|
|
|
|
|
2011-10-24 23:09:39 +00:00
|
|
|
uses gameconfigform, mod_tappywords;
|
2011-09-14 00:35:25 +00:00
|
|
|
|
2011-09-07 17:58:54 +00:00
|
|
|
{$R *.lfm}
|
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
{ TformTappyTuxGame }
|
2011-09-14 00:35:25 +00:00
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
procedure TformTappyTuxGame.btnExitClick(Sender: TObject);
|
2011-09-14 00:35:25 +00:00
|
|
|
begin
|
2011-10-25 14:29:52 +00:00
|
|
|
GetCurrentModule().EndGame();
|
2011-09-14 00:35:25 +00:00
|
|
|
Close;
|
2011-09-15 14:14:50 +00:00
|
|
|
formConfig.Show;
|
2011-09-15 14:34:06 +00:00
|
|
|
|
2011-09-14 00:35:25 +00:00
|
|
|
end;
|
|
|
|
|
2011-10-24 23:09:39 +00:00
|
|
|
procedure TformTappyTuxGame.AnswerKeyPress(Sender: TObject; var Key: char);
|
2011-09-14 01:24:06 +00:00
|
|
|
begin
|
|
|
|
if Key = #13 then
|
|
|
|
begin
|
2011-10-24 23:09:39 +00:00
|
|
|
formTappyTuxGame.Test.Lines.Add(Answer.Text);
|
2011-10-25 10:21:59 +00:00
|
|
|
GetCurrentModule().Answered();
|
2011-10-24 23:09:39 +00:00
|
|
|
formTappyTuxGame.Answer.Clear;
|
2011-10-24 19:51:13 +00:00
|
|
|
|
2011-09-14 01:24:06 +00:00
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
procedure TformTappyTuxGame.FormCreate(Sender: TObject);
|
2011-09-14 00:35:25 +00:00
|
|
|
begin
|
2011-09-15 14:14:50 +00:00
|
|
|
// Creation of internal components
|
|
|
|
vTappyTuxDrawer := TTappyTuxDrawer.Create(Self);
|
|
|
|
vTappyTuxDrawer.Parent := Self;
|
|
|
|
vTappyTuxDrawer.Top := 0;
|
|
|
|
vTappyTuxDrawer.Left := 100;
|
|
|
|
vTappyTuxDrawer.Height := Height-vTappyTuxDrawer.Top;
|
|
|
|
vTappyTuxDrawer.Width := Width-vTappyTuxDrawer.Left;
|
|
|
|
vTappyTuxDrawer.SendToBack();
|
2011-09-14 00:35:25 +00:00
|
|
|
end;
|
|
|
|
|
2011-10-25 14:29:52 +00:00
|
|
|
procedure TformTappyTuxGame.NoClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
GetCurrentModule().EndGame();
|
|
|
|
Close;
|
|
|
|
formConfig.Show;
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
2011-10-25 22:24:00 +00:00
|
|
|
procedure TformTappyTuxGame.TestChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
2011-10-25 14:29:52 +00:00
|
|
|
procedure TformTappyTuxGame.YesClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
Question1.Top := 24;
|
|
|
|
Question2.Top := 24;
|
|
|
|
Question3.Top := 24;
|
|
|
|
Question4.Top := 24;
|
|
|
|
Question5.Top := 24;
|
|
|
|
GetCurrentModule().StartNewGame(formConfig.comboSound.ItemIndex,
|
|
|
|
formConfig.comboMusic.ItemIndex,
|
2011-10-25 22:24:00 +00:00
|
|
|
formConfig.comboLevel.ItemIndex,
|
|
|
|
formConfig.ltbWordlist.ItemIndex);
|
2011-10-25 14:29:52 +00:00
|
|
|
end;
|
|
|
|
|
2011-10-24 23:09:39 +00:00
|
|
|
|
2011-09-07 17:58:54 +00:00
|
|
|
end.
|
|
|
|
|