Einzelnen Beitrag anzeigen

egarF

Registriert seit: 20. Jan 2005
Ort: Stuttgart
21 Beiträge
 
#28

Re: Dartspiel programmieren mit Delphi

  Alt 21. Jan 2005, 21:01
Hey

Das sieht schonmal sehr gut aus @ MrScholz
So genau hab ich mir das vorgestellt, kann es aber leider nicht in die Tat umsetzen...

Hier mein bisheriger Quell-Text:


Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, ExtCtrls, StdCtrls, Buttons;

type
  TForm1 = class(TForm)
    Starten: TBitBtn;
    Schuss: TButton;
    Ergebnis: TButton;
    NeuStarten: TButton;
    Timer1: TTimer;
    Image1: TImage;
    ProgressBar1: TProgressBar;
    ProgressBar2: TProgressBar;
    Beenden: TButton;
    Durchlaufstoppen1: TButton;
    Durchlaufstoppen2: TButton;
    procedure StartenClick(Sender: TObject);
    procedure BeendenClick(Sender: TObject);
    procedure SchussClick(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure NeuStartenClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.StartenClick(Sender: TObject);

begin
{dartscheibe}
image1.canvas.brush.style:=bssolid;
image1.canvas.brush.style:=bssolid;
image1.canvas.brush.color:=clblack;
image1.canvas.ellipse(30,30,290,290);


image1.canvas.brush.style:=bssolid;
image1.canvas.brush.color:=clred;
image1.canvas.ellipse(50,50,270,270);


image1.canvas.brush.style:=bssolid;
image1.canvas.brush.color:=clblack;
image1.canvas.ellipse(70,70,250,250);


image1.canvas.brush.style:=bssolid;
image1.canvas.brush.color:=clred;
image1.canvas.ellipse(90,90,230,230);


image1.canvas.brush.style:=bssolid;
image1.canvas.brush.color:=clblack;
image1.canvas.ellipse(110,110,210,210);


image1.canvas.brush.style:=bssolid;
image1.canvas.brush.color:=clyellow;
image1.canvas.ellipse(130,130,190,190);

image1.canvas.brush.style:=bssolid;
image1.canvas.brush.color:=clblue;
image1.canvas.ellipse(150,150,170,170);


{pfeile}
image1.canvas.pen.width:=2;
image1.canvas.moveto(10,10);
image1.canvas.lineto(20,20);
image1.canvas.moveto(20,10);
image1.canvas.lineto(10,20);


image1.canvas.moveto(40,10);
image1.canvas.lineto(50,20);
image1.canvas.moveto(50,10);
image1.canvas.lineto(40,20);

image1.canvas.moveto(70,10);
image1.canvas.lineto(80,20);
image1.canvas.moveto(80,10);
image1.canvas.lineto(70,20);

end;



procedure TForm1.BeendenClick(Sender: TObject);
begin
close;
end;

procedure TForm1.SchussClick(Sender: TObject);

begin
Timer1.enabled:=true;
end;



procedure TForm1.Timer1Timer(Sender: TObject);
begin
Timer1.enabled:=false;

end;

procedure TForm1.NeuStartenClick(Sender: TObject);
begin

with Image1.canvas do
begin

{pfeile}
image1.canvas.pen.width:=2;
image1.canvas.moveto(10,10);
image1.canvas.lineto(20,20);
image1.canvas.moveto(20,10);
image1.canvas.lineto(10,20);


image1.canvas.moveto(40,10);
image1.canvas.lineto(50,20);
image1.canvas.moveto(50,10);
image1.canvas.lineto(40,20);

image1.canvas.moveto(70,10);
image1.canvas.lineto(80,20);
image1.canvas.moveto(80,10);
image1.canvas.lineto(70,20);

end;

end;

end.

end

Ich bekomme das nciht mit den progressbars hin...
So wie MrScholz das gemacht hat, so hätte ich es auch gerne ...
Dafür reicht mein Wissen aber nicht aus, kann jemand helfen (auch in bezug auf mein QuellText?)

dankeschön schonmal
  Mit Zitat antworten Zitat