ID:149487
 
I was wondering if anyone has found out a good way to set up a 9-tiled mob using those vars. I've gotten it to work but it's kind of a lengthy process that takes a little brain crunching to create the iconstates for it. I make the 9 tiles in photoshop then copy and paste each section into each state then rotate it based upon how I see it in my head. If someone has a better way codewise or graphics wise I'd like to hear it :)

New()
..()
body = list("nw" = new/obj(),"n" = new/obj(),"ne" = new/obj(),"e" = new/obj(),...) //shortened for forum use
var/obj/temp
for(var/direction in body)
temp = body[direction]
temp.icon_state = "[direction]"

temp = body["nw"]
temp.pixel_x = -32
temp.pixel_y = 32
temp.dir = NORTH
overlays += temp
temp = body["n"]
temp.pixel_x = 0
temp.pixel_y = 32
temp.dir = NORTH
overlays += temp
//continues for each direction