ID:177850
 
obj/ball
icon = 'objs.dmi'
icon_state = "ball"
verb
kick()
if(usr's dir is north)
//Make the ball go north,3 tiles north
if(usr's dir is south)
//Make the ball go south,3 tiles south
//also.what here if it hits any player it stops

ETC..WITH DIRections
obj/ball
icon = 'objs.dmi'
icon_state = "ball"
verb
kick()
set src in oview(1)
if(usr.dir == NORTH)
src.x+=1
sleep(1)
src.x+=1
sleep(1)
src.x+=1
if(usr.dir == SOUTH)
src.x+=1
sleep(1)
src.x+=1
sleep(1)
src.x+=1
/* Note that i am not sure if it's X or Y, or why you ever had usr's in the
if statment.
*/


RaeKwon
In response to RaeKwon
obj/ball
icon = 'objs.dmi'
icon_state = "ball"
density = 1
verb
kick()
set category = "Beach Ball"
set src in view(1)
if(usr.dir == NORTH)
src.y+=1
sleep(1)
src.y+=1
sleep(1)
src.y+=1
if(usr.dir == SOUTH)
src.y-=1
sleep(1)
src.y-=1
sleep(1)
src.y-=1
if(usr.dir == EAST)
src.x+=1
sleep(1)
src.x+=1
sleep(1)
src.x+=1
if(usr.dir == WEST)
src.x-=1
sleep(1)
src.x-=1
sleep(1)
src.x-=1

the ball can go over 1 density turfs.is there a way to stop it?
RaeKwon's solution isn't really a good one, because the code gets pretty redundant. You'll get a lot more mileage from get_step(), like this:
var/turf/T
dir=usr.dir // change the ball's direction
for(var/i=1,i<=3,++i)
T=get_step(src,dir)
if(Move(T))
sleep(2)
else
oview(src) << 'thump.wav'
break

Lummox JR