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
ID:177850
Jul 23 2002, 1:31 am
|
|
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 Lummox JR |
RaeKwon