const MaxX = 520;
MaxY = 520;
NF = 16;
type FireBall = Record
dx : Integer;
dy : Integer;
incx : Integer;
incy : Integer;
Count : Extended;
Incer : Extended;
xfac : Integer;
yfac : Integer;
xinc : Integer;
yinc : Integer;
End;
public
{ Public declarations }
Col : Array[0..1515] Of TColor;
Mat : Array[-5..MaxX+5,-5..MaxY+5] Of Integer;
FBall : Array[0..NF] Of FireBall;
DoFlame : Boolean;
DoFireBalls : Boolean;
DoRandFlames : Boolean;
FlameCnt : Integer;
First : Boolean;
Procedure SetupColors;
Procedure SetupPalette;
Procedure DoFlameSweep;
Procedure Circle(x,y,r:Integer);
Procedure DoBall2(N:Integer);
Procedure SetupFireBalls;
Function GetPixelAv2(x,y:Integer):Integer;
Function Distance(x1,y1,x2,y2:Integer):Integer;
Function XComp(t:Extended):Extended;
Function YComp(t:Extended):Extended;
end;
//
// In die ComboBox kommen zwei Einträge
Function TForm1.XComp(t:Extended):Extended;
Begin
If ComboBox1.ItemIndex = 0 Then Result:=sin(3/4*t)
Else
If ComboBox1.ItemIndex = 1 Then Result:=cos(t)
Else
Result := 0;
End;
Function TForm1.YComp(t:Extended):Extended;
Begin
If ComboBox1.ItemIndex = 0 Then Result:=sin(4/4*t)
Else
If ComboBox1.ItemIndex = 1 Then Result:=sin(t)
Else
Result := 0;
End;
Procedure TForm1.SetupColors;
Var x,y:Integer;
Begin
Randomize;
For x:= -5 to MaxX+5 Do
For y:= -5 to MaxY+5 Do Mat[x,y]:=0;
For x:= 0 To MaxX Do
Begin
Mat[x,MaxY]:=127;
Mat[x,MaxY-1]:=127;
Mat[x,MaxY-2]:=127;
End;
SetupPalette;
SetUpFireBalls;
End;
Procedure TForm1.SetupPalette;
Var I:Integer;
Begin
For I:= 1 to 32 Do
Begin
Col[I] := 4+(i-1)*8;
Col[I+32] := 1276+(i+32-1)*2048;
Col[I+64] := 326908+(i+64-1)*524288;
Col[I+96] := 16579836;
Col[I+128]:= 16579836;
Col[I+160]:= 16579836;
Col[I+192]:= 16579836;
Col[I+224]:= 16579836;
Col[I+256]:= 16579836;
Col[I+288]:= 16579836;
Col[I+320]:= 16579836;
Col[I+352]:= 16579836;
Col[I+384]:= 326908+(i+64-1)*524288;
Col[I+416]:= 326908+(i+64-1)*524288;
Col[I+448]:= 326908+(i+64-1)*524288;
Col[I+480]:= 326908+(i+64-1)*524288;
End;
End;
Function TForm1.GetPixelAv2(x,y:Integer):Integer;
Begin
Result:=((Mat[x,y-1]+
Mat[x-1,y]+
Mat[x+1,y]+
Mat[x,y+1]+
Mat[x-2,y]+
Mat[x+2,y]+
Mat[x,y+2]+
Mat[x,y-2]+
Mat[x-1,y+1]+
Mat[x+1,y+1]+
Mat[x-1,y-1]+
Mat[x+1,y-1]) Div 12);
End;
Procedure TForm1.SetupFireBalls;
Var I:Integer;
Begin
Randomize;
For I:= 1 to NF do
With FBall[I] Do
Begin
dx:=Random(maxx-16)+8;
dy:=6;
If random(1) = 0 then incx:=-(random(3))
Else incx:=random(3);
incy:=random(3)+1;
If ComboBox1.ItemIndex = 0 Then Count:=(I-1)*60;
If ComboBox1.ItemIndex = 1 Then Count:=(I-1)*((360/NF)*90/120);
Incer:=0.032;
xfac:=135;
yfac:=135;
xinc:=-2;
yinc:=-2;
End;
End;
Function TForm1.Distance(x1,y1,x2,y2:Integer):Integer;
Begin
Result := Round(Sqrt(sqr(x1+x2)+sqr(y1+y2)));
End;
Function cxcom(t:Extended):Extended;
Begin
Result:=cos(t);
End;
Function cycom(t:Extended):Extended;
Begin
Result:=sin(t);
End;
Procedure TForm1.Circle(x,y,r:Integer);
Var rx,ry:Integer;
i:Integer;
Begin
For I:= 1 to 360 Do
Begin
rx:=Round(r*cxcom(i))+x;
ry:=Round(r*cycom(i))+y;
Mat[rx,ry]:=Random(40)+100;
end;
End;
Procedure TForm1.DoBall2(N:Integer);
Var I :Integer;
Begin
Randomize;
With FBall[N] Do
Begin
If ComboBox1.ItemIndex = 0 Then
Begin
dx:=Round(xcomp(count)*185)+(MaxX Div 2);
dy:=Round(ycomp(count)*185)+(MaxY Div 2);
End;
If ComboBox1.ItemIndex = 1 Then
Begin
dx:=Round(xcomp(count)*xfac)+(MaxX Div 2);
dy:=Round(ycomp(count)*yfac)+(MaxY Div 2);
End;
Count:=Count+Incer;
If (xfac < 10) Or (xfac > 235) Then xinc:=-xinc;
If (yfac < 10) Or (yfac > 235) Then yinc:=-yinc;
xfac:=xfac+xinc;
yfac:=yfac+yinc;
For I:= 1 to 8 Do Circle(dx,dy,I);
End;
End;
Procedure TForm1.DoFlameSweep;
Var x,y:Integer;
c:Integer;
Begin
Randomize;
With PaintBox1.Canvas Do
Begin
For x:= 0 to MaxX Do
For y:= 2 to MaxY Do
If Mat[x,y] > 3 Then
Begin
C:=GetPixelAv2(x,y);
Mat[x,y] := (((C Shr 12) ) mod 256 + C);
Pixels[x,y]:= Col[Mat[x,y]];
End;
End;
Inc(FlameCnt);
End;
procedure TForm1.FormCreate(Sender: TObject);
begin
SetupColors;
DoFlame:=True;
DoFireBalls:=True;
FlameCnt:=0;
First:=True;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
Var N:Integer;
begin
If First Then
Begin
PaintBox1.Canvas.Brush.Color:=clBlack;
PaintBox1.Canvas.Rectangle(PaintBox1.Canvas.Cliprect);
First:=False;
End;
If DoFlame Then DoFlameSweep;
If FlameCnt Mod 70 = 0 Then SetupPalette;
If (DoFireBalls) Then
For N:= 1 to NF do DoBall2(N);
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
If CheckBox1.Checked Then
Begin
DoFireBalls:=True;
SetUpFireBalls;
End
Else
DoFireBalls:=False;
end;
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
PaintBox1.Canvas.Brush.Color:=clBlack;
PaintBox1.Canvas.Rectangle(PaintBox1.Canvas.Cliprect);
If DoFlame Then DoFlameSweep;
end;
Draw Particel Flames
Abonnieren
Posts (Atom)
Beliebte Posts
-
Network Source Code Update Source Code Network Update : https://asciigen.blogspot.com/p/network.html Send Message 1.0 Source Server Client ...
-
Windows Key Sniffer 0.82 - Update 08/2024 Der Windows Key Sniffer hat mir im Laufe der Zeit viel Arbeit erspart und unterstützt, viele Wi...
-
Windows Defender Bypass Version 0.75 - Update 11/2024 Den Windows 10-eigenen Virenschutz Defender kann man auf mehreren Wegen abschalten,...
-
ASCii GIF Animator Update Version 0.68 (32 bit) - 11/2024 Bei dieser überarbeiteten Version ist die Kompatibilität zu den verschiedenen GIF...
-
MD5 Hacker v.0.26 - Update 08.2024 MD5 Hashs sollten eigentlich nicht entschlüsselt werden können. Jedoch gibt es Tools, mit welchen auch ...
-
Host Editor Version 0.64 - Update 11/2024 Hosts File Editor allows for the easy editing of host files and backup creation. Create your own h...
-
Dir Sniffer Version 0.08 - Update 08/2024 Dir Sniffer ist ein kleines aber nützliches Tool um herauszufinden, was ihr Programm auf ihrem...
-
Oldskool Font Generator v.0.29 - Update 11/2023 Das Tool stell 508 Bitmap Fonts zu Verfügung. Eigene Fonts können integriert werden, sie...
-
ASCii Text Creator v.0.24 - Update 11.2023 * Add BugFix Gui Move Message Send * Add 447 Figlet Font Pack * Fixed Invert Unicode Function * ...
Keine Kommentare:
Kommentar veröffentlichen