client/West()
src.mob.dir = WEST
for(var/i=4,i,i--)
sleep(1)
if(!mob.CollisionDetect())
src.mob.pressing = 1
src.mob.px -= mob.pps/4
src.mob.pixel_x -= mob.pps/4
src.pixel_x -= mob.pps/4
if(src.mob.pixel_x == -32)
src.mob.x--
src.mob.pixel_x = 0
src.pixel_x = 0
spawn(1)
src.mob.pressing = 0
atom/movable/proc/CollisionDetect()
switch(src.dir)
if(EAST)
for(var/atom/O in oview(1))
if(O.density ==1&&src.y==O.y)
if(O.px <= src.px+src.pps)
world<<"Too close"
return 1
if(WEST)
for(var/atom/O in oview(1))
if(O.density ==1&&src.y==O.y)
if(O.px >= src.px-src.pps)
world<<"Too close"
return 1
Problem description:
It stops you from moving in any direction if it's too close.
Footnote: The for loop in the West proc is so that it moves more fluently
ts