OK, try this, I think this will now work in DB standard, there's not much difference between this and the first version posted above.
+ Code Snippetsync on : sync rate 60
randomize timer()
set text opaque
bw = bitmap width(0)
bh = bitmap height(0)
rem --- make a sample image on bitmap 0
DrawSomething(0,0)
sync
create bitmap 1, bw, bh
t = 1
do
rem --- make a sample image in bitmap 1
DrawSomething(1,t)
t = t + 1 : if t = 3 then t = 0
set current bitmap 0
ink rgb(255,255,255),0
center text bw / 2, bh - 32, " Press any key! "
sync
wait key
ShatterWipe(1,10,8,10)
sync
loop
end
function DrawSomething(bmp,t)
set current bitmap bmp : cls 0
bw = bitmap width(bmp) : bh = bitmap height(bmp)
for i = 1 to 1000
ink rgb(rnd(255),rnd(255),rnd(255)),0
if t = 0 then dot rnd(bw),rnd(bh)
if t = 1 then line rnd(bw),rnd(bh),rnd(bw),rnd(bh)
if t = 2
r = rnd(40) + 10
ellipse rnd(bw),rnd(bh),r,r
endif
next i
endfunction
function ShatterWipe(bmp,columns,rows,speed)
remstart
bmp = source bitmap to be displayed in bitmap 0 (bmp size must equal bitmap 0)
columns, rows = number of divisions in bitmap. It's best to use values
that can easily divide into width and height of bitmap (min 4, max 20)
speed = how fast you want the blocks to fly
remend
if bitmap exist(bmp) and bmp > 0
bw = bitmap width(0) : bh = bitmap height(0)
if bw = bitmap width(bmp) and bh = bitmap height(bmp)
if columns < 4 then columns = 4
if columns > 20 then columns = 20
if rows < 4 then rows = 4
if rows > 20 then rows = 20
if speed < 1 then speed = 1
spritetotal = columns * rows
spritewidth = bw / columns
spriteheight = bh / rows
offsetx = spritewidth / 2
offsety = spriteheight / 2
dim xd(spritetotal) : dim yd(spritetotal)
sx = 0 : sy = 0
for i = 1 to spritetotal
s = 65536 - i
rem --- set sprite
get image s, sx, sy, sx + spritewidth, sy + spriteheight, 1
sprite s, sx+offsetx, sy+offsety, s : offset sprite s, offsetx, offsety
set sprite s, 1, 0
inc sx, spritewidth
if sx >= bw
sx = 0
sy = sy + spriteheight
endif
rem --- set direction speed and rotation speed of sprite
repeat : xd(i) = (rnd(speed*2) - speed) : until abs(xd(i)) > speed / 2
repeat : yd(i) = (rnd(speed*2) - speed) : until abs(yd(i)) > speed / 2
next i
copy bitmap bmp,0
spritesoffscreen = 0
rem <-- Play sound here
rem --- Ok, here we go! Loops until all blocks are off screen
repeat
for i = 1 to spritetotal
s = 65536-i
if sprite exist(s)
rem --- update sprite position
sx = sprite x(s) + xd(i)
sy = sprite y(s) + yd(i)
sprite s, sx, sy, s
rem --- if sprite off screen then delete it
if sx > (bw + offsetx) or sx < -offsetx or sy > (bh + offsety) or sy < -offsety
delete sprite s
delete image s
spritesoffscreen = spritesoffscreen + 1
endif
endif
next i
sync
until spritesoffscreen = spritetotal
rem --- clean up and exit
undim yd() : undim xd()
endif
endif
endfunction
I had to drop the following:
1) Rotating the sprites, because DB standard does not support this.
2) The Draw Sprites Last command, I believe sprites are always drawn last in DB standard (I can't remember).
3) Any references of Inc (or Dec) these two commands are not present in DB standard (well, version 1.0 anyway).
As for other wipes, I only created this wipe because I was stuck for something to do at the time, so I havn't made any others since, sorry. Perhaps next time when I have'nt anything to do