ID:2035990
 
(See the best response by Mattdawgak.)
Code:


Problem description:
Say I have a icon like this, https://gyazo.com/4722c6ee366393dcc97be32d514fef96, and I want it to go a step/pixel at a time to make it seem like moving, because walk makes it go before it finishes shooting down. I want it to seem like it's shooting down a new bolt every tile, how would I accomplish this?
Best response
Check out http://www.byond.com/developer/Forum_account/Sidescroller it's help me with doing almost every kind of pixel movement etc.

If you need more help after that post in here again with some code of what you have tried and maybe we can help further.
I tried this, it only created the first obj and from there forth none of the others.
Lightning_Road()
var/mob/m = usr

if(!m.checkStatus("Lightning Road", 420))
return

flick("punch", m)
m.setDelay("Action", world.time + 10)
m.setDelay("Lightning Road", world.time + 30)
m.chi -= 420

view(8)<<"<b><center><font size=3><font color=teal>[src]: Lightning Road!</b></font>"
var/obj/lightning_road/a=new/obj/lightning_road(m.loc)
a.pixel_y=-68
a.pixel_x=-48
spawn(5)
del a
if(m.dir==WEST)
var/obj/lightning_road/b=new/obj/lightning_road
//b.pixel_y=-68
b.pixel_x=34
if(m.dir==EAST)
var/obj/lightning_road/b=new/obj/lightning_road(m.pixel_x-5)
b.pixel_y=-68
b.pixel_x=-48
if(m.dir==NORTH)
var/obj/lightning_road/b=new/obj/lightning_road(m.pixel_y+5)
b.pixel_y=-68
b.pixel_x=-48
if(m.dir==SOUTH)
var/obj/lightning_road/b=new/obj/lightning_road(m.pixel_y-5)
b.pixel_y=-68
b.pixel_x=-48
In response to Edit Nero
Okay I may be wrong but I would make it more something like this
        var/obj/lightning_road/a=new/obj/lightning_road
var/obj/lightning_road/b=new/obj/lightning_road
var/obj/lightning_road/c=new/obj/lightning_road
var/obj/lightning_road/d=new/obj/lightning_road
if(Executor.dir==EAST)
A:x+=3//Any number you wish here on downwards
B:x+=1
C:y+=1
D:y+=1
D:x+=3
if(Executor.dir==WEST)//etc..
A:x-=3
B:x-=1
C:y+=1
D:y+=1
D:x-=3
In response to Dragonpearl123
You're abusing the : operator, and you got the var names wrong because in one spot they're lowercase and in another they're uppercase.

The set of if() statements for each direction is kind of awful too, but the OP has the same issue.
In response to Lummox JR
ehhem it was a quick sketch.
In response to Dragonpearl123
Thanks, this helped.