Greetings.
There was a thread awhile back that had some good 2d shadows. I just found it, and made it neater, and put it into some functions for multiple sprites.
So far, ive just made 3 functions, so here they are.
Function MAKESHADOW(shadowedsprite,shadowspritenum,shadowimage)
sprite shadowspritenum,sprite x(shadowedsprite),sprite y(shadowedsprite),shadowimage
offset sprite shadowspritenum,sprite width(shadowspritenum)/2,sprite height(shadowspritenum)/2
set sprite alpha shadowspritenum,100
endfunction
Function MAKELIGHT(lightx,lighty,spritenum,imagenum)
sprite spritenum,lightx,lighty,imagenum
offset sprite spritenum,sprite width(spritenum)/2,sprite height(spritenum)/2
endfunction
Function SHADOWSPRITE(spritenum,shadownum,shadowimage,lightx,lighty)
X#=sprite x(shadownum)
Y#=sprite y(shadownum)
x1#=((X#-lightx)*(X#-lightx))+((Y#-lighty)*(Y#-lighty))
x1#=ABS(x1#)
x1#=sqrt(x1#)
y1#=Atanfull((lightx-X#),(lighty-Y#))
size sprite shadownum,x1#+100,100
if x1#<255
set sprite alpha shadownum,(x1#*-1)+255
endif
spriteangle#=(y1#-(y1#*2))+90
shadowangle#=(y1#-(y1#*2))+270
rotate sprite spritenum,spriteangle#
rotate sprite shadownum,shadowangle#
endfunction
Im working on aving the sprites move, ive done it, but i havnt put it into function form yet.
EDIT: mm, this only works with circles...
EDIT: oh, this code was orig by BiggAdd