O.K., I've been trying to make a special effect where you can manipulate the background in a 2D fashion while keeping the foreground the same. It's mostly finished, except the sprite I use expands for some reason and moves some of the objects outside of the screen.
input "Speed ",b
input "Height ",a
sync on
backdrop off
global width
global height
global depth
make object sphere 1,1
autocam off
make object sphere 2,1
make object cube 3,1
make object cylinder 4,1
randomize timer()
for x=2 to 4
position object x,rnd(6)-3,rnd(6)-3,rnd(5)+10
next x
dim exclude(1) as integer
dim blur(3) as integer
exclude(1)=1
blur(1)=2
blur(2)=3
blur(3)=4
blur_background(1,1)
while returnkey()=0
inc c
ink rgb(sin(c)*255,sin(c)*255,sin(c)*255),0
center text screen width()/2,screen height()/2,"Press Enter When Ready"
sync
endwhile
do
move=hwave(a,b,move,width,height,3,1,1)
set cursor 0,100
print sprite width(1)
print sprite height(1)
print screen width()
print screen height()
sync
loop
`this function needs to be used in conjunction with an array called 'exclude' and 'blur'
`exclude will hold the numbers of the objects that will not be affected by this command
`you also need to include an image blurring function
`sync must be on and width/height/depth should be global
function blur_background(image,mem)
for x=1 to array count(exclude(0))
exclude object on exclude(x)
next x
sync : sync
get image image,0,0,screen width(),screen height()
make memblock from image image,mem
width=memblock dword (mem,0)
height=memblock dword (mem,4)
depth=memblock dword (mem,8)
dim image(width,height) as integer
for x=1 to width
for y=1 to height
image(x,y)=memblock dword(mem,((y-1)*width+x-1)*4+12)
next y
next x
for x=1 to array count(exclude(0))
exclude object off exclude(x)
next x
sync : sync
for x=1 to array count(blur(0))
exclude object on blur(x)
next x
draw sprites first
endfunction
function hwave(mxheight,movespd#,move,width,height,image,mem,sprite1)
for x=1 to width
yplus=mxheight*sin(movespd#*(x+move))
for y=1 to height
if y+yplus<height and yplus+y>0
write memblock dword 1,((y+yplus-1)*width+x-1)*4+12,image(x,y)
endif
next y
next x
if move=movespd#*2*3.141 then move=0
inc move
`display the image
make image from memblock image,mem
sprite sprite1,0,0,image
size sprite sprite1,screen width(),screen height()
endfunction move
P.S. You'll notice that line 105 should make the image exactly the size of the screen but doesn't. The numbers on the left are the size of the screen and sprite. Finally, you can change the objects affected at lines 22-27