Registriert seit: 26. Aug 2013
81 Beiträge
Delphi 10 Seattle Professional
|
AW: Lazarus merkwürdiges Verhalten
26. Feb 2014, 11:57
Delphi-Quellcode:
procedure TForm1.PowerupGenerator;
begin
Randomize;
n := Random(2);
randomX := Random(Image1.Width - 20);
randomY := Random(Image1.Height -20);
case n of
0: // gelbes powerup generiert
begin
Image1.Canvas.Pen.Color:=clYellow;
Image1.Canvas.Brush.Color := clYellow;
Image1.Canvas.Ellipse(randomX,randomY,randomX+10,randomY+10);
Image1.Canvas.Pen.Color:=clBlue;
Image1.Canvas.Brush.Color := clBlue;
end;
1: //lilanes powerup generiert
begin
Image1.Canvas.Pen.Color:=clPurple;
Image1.Canvas.Brush.Color := clPurple;
image1.Canvas.Ellipse(randomX,randomY,randomX+10,randomY+10);
Image1.Canvas.Pen.Color:=clBlue;
Image1.Canvas.Brush.Color := clBlue;
end;
end;
end;
und wird zwei mal aufgerufen
|
|
Zitat
|