Eu estou fazendo um quiz no Delphi, sou iniciante, preciso da vossa ajuda.
1º : Quero ajuda para adicionar ao meu jogo como adicionar pontos cada vez que o jogador acertar a resposta correta.
2º : Ajuda também aqui: Se o jogador não concluir o nível, então na 3ª tentativa ele perde todos os pontos. Então me ajudem como fazer isso no Delphi. Com essas duas características mencionadas
Aqui o código (vai ter vários forms com perguntas sobre temas variados, como o quiz "Show do milhão") :
Unit U_quiz;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.UITypes, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Imaging.jpeg,
Vcl.ExtCtrls;
type
Tfrm_nivel1 = class(TForm)
Label1: TLabel;
rb_um: TRadioButton;
rd_dois: TRadioButton;
rb_tres: TRadioButton;
lb_dois: TLabel;
rb_quatro: TRadioButton;
rb_cinco: TRadioButton;
rb_seis: TRadioButton;
Label2: TLabel;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
Label3: TLabel;
RadioButton4: TRadioButton;
RadioButton5: TRadioButton;
RadioButton6: TRadioButton;
Label4: TLabel;
RadioButton7: TRadioButton;
RadioButton8: TRadioButton;
RadioButton9: TRadioButton;
Image1: TImage;
procedure rb_umClick(Sender: TObject);
procedure rd_doisClick(Sender: TObject);
procedure rb_tresClick(Sender: TObject);
procedure rb_quatroClick(Sender: TObject);
procedure rb_cincoClick(Sender: TObject);
procedure rb_seisClick(Sender: TObject);
procedure RadioButton4Click(Sender: TObject);
procedure RadioButton5Click(Sender: TObject);
procedure RadioButton6Click(Sender: TObject);
procedure RadioButton9Click(Sender: TObject);
procedure RadioButton7Click(Sender: TObject);
procedure RadioButton8Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_nivel1: Tfrm_nivel1;
implementation
{$R *.dfm}
procedure Tfrm_nivel1.rb_tresClick(Sender: TObject);
var c:Boolean;
begin
c:= not false;
if c=true then
c:= (true);
Messagedlg('Acertou! Você ganhou 30 pontos!',mtInformation,[mbOk],0);
end;
procedure Tfrm_nivel1.rb_umClick(Sender: TObject);
var a: Boolean;
begin
a:= not true;
if a=true then
a:= (false);
Messagedlg('Errou! Tente outra vez!',mtInformation,[mbOk],0);
end;
procedure Tfrm_nivel1.rd_doisClick(Sender: TObject);
var b: Boolean;
begin
b:= not true;
if b=true then
b:= (false);
Messagedlg('Errou! Tente outra vez!',mtInformation,[mbOk],0);