I made a simple image memblock trick which sort of looks like a flashlight. Run this code and see what you think.
`Flashlight using image memblock
sync on
hide mouse
width=150
height=150
make memblock 1,width*height*32*4+12
write memblock dword 1,0,width
write memblock dword 1,4,height
write memblock dword 1,8,32
for x=1 to width
for y=1 to height
write memblock dword 1,((y-1)*width+x-1)*4+12,rgb(0,0,0)
next y
next x
make image from memblock 1,1
sprite 1,0,0,1
size sprite 1,screen width(),screen height()
make object cube 1,10
do
sync
yrotate object 1,object angle y(1)+0.1
for x=1 to width
for y=1 to height
dist#=sqrt((mousex()-x*(screen width()/(width+0.0)))^2+(mousey()-y*(screen height()/(height+0.0)))^2)
if dist#>255
trans=255
r=0
g=0
b=0
else
trans=dist#
r=(255-dist#)
g=(255-dist#)
b=0
endif
write memblock dword 1,((y-1)*width+x-1)*4+12,rgb(r,g,b)
write memblock word 1,((y-1)*width+x-1)*4+15,trans
next y
next x
make image from memblock 1,1
loop