hallo leute.....
also ich bin richtig richtig schlecht im programmieren!
ich habe es geschafft zwei images zum "laufen" zum bringen und das nach einem bestimmten weg anhalten.
jetzt komm ich nicht mehr weiter!
wenn die schnecken nun angehalten sind soll ein fenster mit einer mathefrage aufspringen!
wenn man diese richtig löst soll die schnecke weiterlaufen, wenn nicht dann nicht.
die computerschnecke dagegen bewegt sich konstant, jedoch etwas langsamer, sodas man auch noch die chane hat mit falschen fragen zu gewinnen.
könnt ihr mir weiterhelfen?
ich muss das programm am montag vorstellen
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, jpeg;
type TForm1 = class(TForm) Image1: TImage; Image2: TImage; Timer1: TTimer; Button1: TButton; RadioButton1: TRadioButton; RadioButton2: TRadioButton; RadioButton3: TRadioButton; procedure Button1Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); private public end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); var l1:integer ; begin l1:=image1.left; image1.Left:= l1+2; end;
procedure TForm1.Timer1Timer(Sender: TObject); var l1,l2:integer ; begin randomize; l1:=image1.left; image1.Left:= l1+random(15); l2:=image2.left; image2.Left:= l2+random(10); if image1.Left>=800 then image1.left:=0; if image2.Left>=800 then image2.left:=0; if image1.left>150 then timer1.Enabled:=false;
end;
end. |
Moderiert von
Christian S.: Delphi-Tags hinzugefügt