`gazakka 2017
set display mode 1920,1080,32
sync on : sync rate 60
set text size 50
d3d_init
num=19232
randomize timer()
load image "2.bmp",1,1 `choose an image 1920,1080
load bitmap "3.bmp",1 `and maybe another
dim rectx(num)
dim recty(num)
dim szx#(num)
dim szy#(num)
dim mulx#(num)
dim muly#(num)
dim growcx(num)
dim growcy(num)
for f=0 to num:growcx(f)=0:growcy(f)=0
xx=rnd(44)
x$="1.01"+str$(xx)
xx#=val(x$)
yy=rnd(44)
y$="1.01"+str$(yy)
yy#=val(y$)
mulx#(f)=xx#
muly#(f)=yy#
next f
dim col(15)
col(0)=rgb(200,0,0):col(1)=rgb(0,200,0):col(2)=200:col(3)=rgb(0,200,200):col(4)=rgb(180,0,230)
col(5)=rgb(200,170,0):col(6)=rgb(150,200,0):col(7)=rgb(80,80,80)
col(8)=rgb(250,250,250):col(9)=rgb(255,200,0):col(10)=rgb(120,120,120)
col(11)=rgb(0,100,200):col(12)=rgb(120,0,255)
col(13)=rgb(255,100,0):col(14)=rgb(160,255,0):col(15)=rgb(0,250,0)
f2=0 : f3=0 : f4=0
contx=0
conty=0
fram=0
delay=100
funk=22
set current bitmap 0
`````````````````````````````````````
do
paste image 1,0,0
gosub makerect
gosub grow
gosub draw
pops:
`gosub saver if you want to make a string of images for a vid
sync
loop
`````````````````````````````
makerect:
if rnd(1000)>funk then return
grump=2
popq:
if rectx(f2)>0 then goto hunk:
rx=10+rnd(1909)
ry=10+rnd(1069)
sx#=1+rnd(1000)/1000
sy#=1+rnd(1000)/1000
lopf:
rx1=rectx(f2)-szx#(f2)
rx2=rectx(f2)+szx#(f2)
if rx=>rx1 and rx<rx2 then goto fail
ry1=recty(f2)-szy#(f2)
ry2=recty(f2)+szy#(f2)
if ry=>ry1 and ry<ry2 then goto fail
hunk:
inc f2
if f2>num then f2=0
`initiate new one
if funk<999 then inc funk
rectx(f2)=rx
recty(f2)=ry
szx#(f2)=sx#
szy#(f2)=sy#
growcx(f2)=1
growcy(f2)=1
fail:
inc f2
dec grump:if grump>0 then goto popq
return
``````````````````````
grow:
for g=0 to num
if growcx(g)=0 then goto nex
if szx#(g)<1 or szy#(g)<1 then goto nex
gx#=szx#(g)
gy#=szy#(g)
ggxr=rectx(g)+gx#
ggxl=rectx(g)-gx#
ggyr=recty(g)+gy#
ggyl=recty(g)-gy#
if ggxr>1910 or ggxl<5 then growcx(g)=0:goto nex
if ggyr>1070 or ggyl<5 then growcy(g)=0:goto nex
f=0
lopf2:
if f<>g
`if growc(f)>0
rx1=rectx(f)-szx#(f)
rx2=rectx(f)+szx#(f)
if rx1=>ggxr or rx2=<ggxl then goto flch `fail no overlap on horizontal
ry1=recty(f)-szy#(f)
ry2=recty(f)+szy#(f)
if ry1=>ggyr or ry2=<ggyl then goto flch `fail no overlap on horizontal
if rx1=<ggxr or rx2=>ggxl then growcx(f)=0:growcx(g)=0 `hit
if ry1=<ggyr or ry2=>ggyl then growcy(f)=0:growcy(g)=0 `hit
flch:
endif
`endif
nex1:
inc f:if f<num then goto lopf2
if growcx(g)=1 then szx#(g)=szx#(g)*mulx#(g)
if growcy(g)=1 then szy#(g)=szy#(g)*muly#(g)
nex:
next g
return
``````````````````````
draw:
for g=0 to num
if szx#(g)>1
x=rectx(g)
y=recty(g)*1920
y=y+x
aa=rectx(g):bb=recty(g)
cc=aa:dd=bb
aa=aa-szx#(g):bb=bb-szy#(g)
cc=cc+szx#(g):dd=dd+szy#(g)
x=x and 15
if x=10 then x=11
set current bitmap 1
if aa>-1
get image 2,aa,bb,cc,dd,1
set current bitmap 0
paste image 2,aa,bb
endif
if growcx(g)=0 or growcy(g)=0 then x=10
ink rgb(10,10,10)
box aa+2,bb+2,cc,bb+4
box aa+2,dd-1,cc+2,dd+1
box aa+2,bb+3,aa+3,dd
box cc,bb+3,cc+2,dd
g1=col(x)
ink g1
box aa,bb+1,cc-1,bb+3
box aa,dd-4,cc-1,dd-2
box aa,bb+1,aa+2,dd-2
box cc-3,bb+1,cc-1,dd-2
`D3D_ROUNDED_BOX aa,bb,cc,dd,2,g1
endif
next g
return
``````````````````````
saver:
sv$="00000"
inc fra:sv1$=str$(fra):sv$=sv$+sv1$
sv$=right$(sv$,5)
fil$="e:\frames4\":fil$=fil$+sv$+".bmp"
get image 4000,0,0,1920,1080,1
save image fil$,4000
if fra>9000 then end
return
````````````````````
loader:
a$="00000":a$=a$+str$(fram):a$=right$(a$,4)
b$="e:\frames3\"+a$+".bmp"
load image b$,2,1
if fram<2904 then inc fram
if frame=2904 then end
return