Alles möglichst originalgetreu gehalten.
Code: Alles auswählen
InitSprite()
InitKeyboard()
OpenScreen(1024,768,32,"test")
id=LoadFont(1,"Magic the Gathering",50)
If CreateSprite(1,1024,768)=0
End
EndIf
Procedure DrawFl(x,y,col)
Circle(x,y-5,6,col)
If col=$1AF4E5
Circle(x,y-5,3,$3E4A75)
Else
Circle(x,y-5,3,$ffff)
EndIf
EndProcedure
Structure pf
x.l
y.l
ux.l
uy.l
col.f
sp.l
EndStructure
Structure fl
x.l
y.l
x2.l
y2.l
fl.l
col.l
EndStructure
Global Dim flower.fl(50,100)
NewList p.pf()
Procedure deleteflowers()
For a=0 To 50
For b=0 To 100
flower(a,b)\x=0
flower(a,b)\y=0
flower(a,b)\x2=0
flower(a,b)\y2=0
flower(a,b)\fl=0
flower(a,b)\col=0
Next
Next
EndProcedure
delay=1000
state=1
Repeat
ExamineKeyboard()
FlipBuffers()
If delay<0
state+1
delay=1000
Else
delay-10
EndIf
If state>2 Or state=1
draw=1
Else
draw=0
EndIf
If oldstate=4 And state=5
count=0
EndIf
If oldstate=6 And state=7
sin.f=0
count=0
EndIf
If State=8 And oldstate=7
deleteflowers()
For a=1 To 50
flower(a,0)\x=Random(1004)+10
flower(a,0)\y=680+Random(20)-10
flower(a,0)\x2=flower(a,0)\x+Random(10)-5
flower(a,0)\y2=flower(a,0)\y-5-Random(10)
Next
EndIf
If state=4 And oldstate=3
ForEach p()
If p()\col<>$ff
DeleteElement(p())
EndIf
Next
EndIf
oldstate=state
If draw=1
If StartDrawing(SpriteOutput(1))=0
Debug "No Sprite drawing"
EndIf
start=1
If claus=0
Box(0,0,1024,768,0)
EndIf
EndIf
Select state
Case 1
DrawingMode(1)
DrawingFont(id)
DrawText(105,105,"Alles Gute zum Muttertag",$00ff,0)
claus=1
Case 2
ClearList(p())
StartDrawing(SpriteOutput(1))
For x=0 To 1023
For y=0 To 700
tmp=Point(x,y)
If tmp<>0 And tmp<>$ff00
AddElement(p())
p()\x=x
p()\y=y
p()\ux=x
p()\uy=y
p()\col=tmp
If tmp=$ff
p()\sp=Random(2)+2
Else
p()\sp=Random(2)+4
If Random(1)=0 Or Random(2)=0
DeleteElement(p())
EndIf
EndIf
EndIf
Next
Next
StopDrawing()
claus=0
state+1
Case 3
ForEach p()
If p()\y<700 Or p()\col<>$ff
p()\y+p()\sp
EndIf
If p()\y>766
DeleteElement(p())
Else
current=ListIndex(p())
currenty=p()\y
currentx=p()\x
If Random(1)=1
Plot(p()\x,p()\y,p()\col)
EndIf
EndIf
Next
delay+7
Case 4
delay+6
count+1
sin.f+0.005/Round(count/12,1)
ForEach p()
p()\y=700-Abs(Sin((p()\ux+300)/p()\uy/3*sin)*700)
p()\x=p()\ux-Abs(Sin(Cos(p()\ux/1000*sin)*Sin(p()\uy/1000*sin)*5)*p()\ux)
Plot(p()\x,p()\y,p()\col)
p()\col=RGB(Abs(Cos(sin+p()\y/100)*255),Abs(Sin(sin+p()\x/100)*255),Abs(Cos(sin+p()\y/100-p()\x/100)*255))
Next
Case 5
delay+6
count+1
sin.f-0.005/Round(count/12,1)
ForEach p()
p()\y=700-Abs(Sin((p()\ux+300)/p()\uy/3*sin)*700)
p()\x=p()\ux-Abs(Sin(Cos(p()\ux/1000*sin)*Sin(p()\uy/1000*sin)*5)*p()\ux)
Plot(p()\x,p()\y,p()\col)
p()\col=RGB(Abs(Cos(sin+p()\y/100)*255),Abs(Sin(sin+p()\x/100)*255),Abs(Cos(sin+p()\y/100-p()\x/100)*255))
Next
Case 6
delay+7
sin.f+0.05
ForEach p()
If p()\y>p()\uy
p()\y-p()\sp*2+Sin(sin+p()\x/100)*2
Plot(p()\x+Sin(sin+p()\x/100)*30,p()\y-Cos(sin+p()\y/100)*30,p()\col)
p()\col=RGB(Abs(Cos(sin+p()\y/100)*255),Abs(Sin(sin+p()\x/100)*255),Abs(Cos(sin+p()\y/100-p()\x/100)*255))
Else
Plot(p()\x+Sin(sin+p()\x/100)*30,p()\uy,p()\col)
EndIf
Next
Case 7
ForEach p()
p()\x=p()\ux
p()\y=p()\uy
Next
state+1
Case 8
ForEach p()
Plot(p()\x,p()\y,p()\col)
Next
delay+9
claus=1
b=0
For a=1 To 50
Repeat
LineXY(flower(a,b)\x,flower(a,b)\y,flower(a,b)\x2,flower(a,b)\y2,$ff00+$ff*flower(a,b)\fl)
b+1
Until flower(a,b)\x=0 Or b>98
If Random(15)=1
If Random(4)=1
in$=Str(Val(in$)+1)
flower(a,b)\x=flower(a,b-1)\x2
flower(a,b)\y=flower(a,b-1)\y2
flower(a,b)\x2=flower(a,b)\x+Random(20)-10
flower(a,b)\y2=flower(a,b)\y-2-Random(4)
flower(a,b)\fl=1
Select Random(3)
Case 0
flower(a,b)\col=$ff66ff
Case 1
flower(a,b)\col=$1AF4E5
Case 2
flower(a,b)\col=$C0E93F
Case 3
flower(a,b)\col=$1643E9
EndSelect
b+1
bstep=1
EndIf
flower(a,b)\x=flower(a,b-1-bstep)\x2
flower(a,b)\y=flower(a,b-1-bstep)\y2
flower(a,b)\x2=flower(a,b)\x+Random(10)-5
flower(a,b)\y2=flower(a,b)\y-5-Random(10)
bstep=0
EndIf
b=0
Next
For a=1 To 50
Repeat
If flower(a,b)\fl
DrawFl(flower(a,b)\x2,flower(a,b)\y2,flower(a,b)\col)
EndIf
b+1
Until flower(a,b)\x=0 Or b>98
b=0
Next
Case 9
delay+6
Case 10
state=1
Default
End
EndSelect
If start=1
StopDrawing()
start=0
EndIf
DisplaySprite(1,0,0)
Until KeyboardPushed(#PB_Key_Escape)