THIS IS MAIN CODE:
mob/Shadow
density = 0
proc/Shadow()
..()
spawn while(2)
sleep(1)
for(var/mob/O in world)
if(src.owner==O)
src.icon -= rgb(2500,2500,2500)
New()
src.Shadow()
mob/var/bottom = 0
mob/Move()
..()
for(var/mob/Shadow/O in world)
if(O.owner==usr)
O.loc = locate(usr.x,usr.y-1,usr.z)
O.dir = usr.dir
if(usr.y==0)
usr.bottom = 1
world.New()
BottomShadow()
proc/BottomShadow()
spawn while(2)
sleep(3)
for(var/mob/Shadow/O in world)
if(O.x==0 && O.y==0 && O.z==0)
var/mob/P = O.owner
O.loc = locate(P.x,P.y-1,P.z)
THIS IS INITIAL CODE TO CREATE:
var/mob/O = new/mob/Shadow(usr.x,usr.y-1,usr.z)
O.name = "[usr]'s Shadow"
O.owner = usr
O.icon = usr.icon
O.icon_state = usr.icon_state
var/icon/I = new(O.icon,O.icon_state)
I.Flip(NORTH)
O.icon = I
O.icon += rgb(20,20,20)
Anyway, what you want is a pixel-offsetted overlay. Look up the 'pixel_y' and 'pixel_x' vars and the 'overlays' var.