Using planes in that way, is a tad above my head, something I'll have think about.
However, by modifying the ShatterWipe function slightly, I think I can produce something like what you suggest. The advantage with this version is it does'nt need an extra bitmap.
sync on : sync rate 60 : autocam off
randomize timer()
make matrix 1,1000,1000,20,20
make object cube 1,100 : position object 1,400,50,400 : color object 1,rgb(255,0,0)
make object sphere 2,100,16,8 : position object 2,500,50,500 : color object 2,rgb(0,255,0)
make object cone 3,100 : position object 3,600,50,600 : color object 3,rgb(0,0,255)
dist# = 300
an# = 0
gosub updatecamera
do
if leftkey()
an# = an# + 2
gosub updatecamera
endif
if rightkey()
an# = an# - 2
gosub updatecamera
endif
if spacekey()
rem --- create new view, but does not update until next sync (within ShatterWipe)
an# = an# + rnd(180) + 90
gosub updatecamera
ShatterWipe(1,10,8,8)
endif
text 0,0,"Use left/right keys to move"
text 0,16,"Press space to shatter"
sync
loop
updatecamera:
position camera newxvalue(500,an#,dist#),150,newzvalue(500,an#,dist#)
point camera 500,50,500
return
function ShatterWipe(bmp,columns,rows,speed)
remstart
bmp = source bitmap to be displayed in bitmap 0 (size must equal to 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
NOTE: uses DRAW SPRITES LAST in order to work properly
remend
bw = bitmap width(0) : bh = bitmap height(0)
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) : dim an(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, 0, 0
inc sx, spritewidth
if sx >= bw
sx = 0
inc 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
repeat : an(i) = (rnd(speed*2) - speed) : until abs(an(i)) > speed / 2
next i
draw sprites last
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 and rotation
sx = sprite x(s) + xd(i)
sy = sprite y(s) + yd(i)
sprite s, sx, sy, s
rotate sprite s,wrapvalue(sprite angle(s) + an(i))
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
inc spritesoffscreen, 1
endif
endif
next i
sync
until spritesoffscreen = spritetotal
rem --- clean up and exit
undim an() : undim yd() : undim xd()
endfunction
Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.