Thema: Delphi Pixel Schneefall :D

Einzelnen Beitrag anzeigen

toshiba

Registriert seit: 1. Dez 2008
8 Beiträge
 
Delphi 7 Professional
 
#17

Re: Pixel Schneefall :D

  Alt 2. Dez 2008, 20:26
Delphi-Quellcode:
unit Flocken;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Timer1: TTimer;
    Button2: TButton;
    Shape1: TShape;
    Tarray: array[0..1280] of integer;
    procedure Button1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);

  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  feld:Tarray;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  timer1.Enabled:=true;

end;
       var a,x,y,x0,y0:integer;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
        a:=2;
        x:=random(8)+3;
        y:=3;
        x0:=random(1500)+20;
        y0:=random(1000)+20;
 with canvas do
   begin
     Pen.color:=clwhite;
     moveto(x+x0,y0-x);
     LineTo(x0-x,y0+x);
     moveto(x0-x,y0-x);
     LineTo(x0+x,y0+x);
     moveto(x0,y0-x);
     LineTo(x0,y0+x);
     moveto(x0-x,y0);
     LineTo(x0+x,y0);
   end;
   feld [100]:=random(10);
    shape1.Left:=shape1.Left+a ;
    if shape1.left>=1280 then shape1.Left:=-20;
 end;

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

procedure TForm1.FormCreate(Sender: TObject);
begin
  form1.Doublebuffered:=true;
end;


end.
so siet das bis jetzt aus... xD

aber naja aller anfang ist schwer!
  Mit Zitat antworten Zitat