ID:157033
 
Move()
if(!src.canmove)
return
..()
var/oldloc=src.loc
var/olddir=src.dir
var/owned=src.owner
var/obj/trail/N=new/obj/trail
N.loc=oldloc
N.dir=olddir


this produces trails but i want to know how to handle the trails turning smoothly as in a transition from north to east provides a new trail to mkae it look joint together. at the moment i get this:


http://dl.dropbox.com/u/3010721/Untitled.jpg
Make the diagonal icon states the connecting icon states and then set the dir to that connecting state (ex: if the beam was going north than it turned east, make the icon state northeast).

This is done rather easily:
 if(!src.canmove)
del src // Why keep it when there's no point?
var
oldloc = src.loc
olddir = src.dir
.=..() // After this, the src.loc is NOT the same as oldloc (if the Move() is successful)!
if(!(.)) del src // If it cannot move, get rid of it
var/obj/trail/N = new(oldloc) // Makes a new trail at the old location
N.owner = src.owner
N.dir = olddir
if(src.dir != olddir) // If the direction changed.
N.dir |= src.dir // Bit operation. If the old dir was NORTH, new dir is EAST, this does NORTH|EAST = NORTHEAST
In response to GhostAnime
ah thanks. especially for the comments about how to improve other things that i had coded in.