mob
var
py=0
px=0
ry=4
rx=4
angle=0
realicon
speed = 5
mob
proc
Update()
var/icon/myicon=new/icon(usr.realicon)
myicon.Turn(usr.angle)
icon = myicon
client
East()
mob.angle +=15
mob.Update()
West()
mob.angle -=15
mob.Update()
North()
var/turf/T = locate(mob.x,mob.y+1,mob.z)
if(T.density==1)
return
else
mob.speed = abs(mob.speed)
mob.pixel_x+=sin(mob.angle)*mob.speed
mob.pixel_y+=cos(mob.angle) *mob.speed
if(mob.pixel_x>=96)
mob.pixel_x=0
mob.x+=3
if(mob.pixel_y>=96)
mob.pixel_y=0
mob.y+=3
South()
var/turf/T = locate(mob.x,mob.y-2,mob.z)
if(T.density==1)
return
else
mob.speed = abs(mob.speed)
mob.pixel_x-=sin(mob.angle)*mob.speed
mob.pixel_y-=cos(mob.angle) *mob.speed
if(mob.pixel_x<=-96)
mob.pixel_x=0
mob.x-=3
if(mob.pixel_y<=-96)
mob.pixel_y=0
mob.y-=3
Problem description:
I have two problems, first, when I go west and when I get close to the end of the screen then there is like a invisible wall blocking me from continuing, but all of the other directions work. My second problem is the collision. When I hit a wall by pressing north it stops but if I back on up and try pressing north again nothing will happen.
it may not have worked before because you're trying to make it a negative angle
also you might want to do this for the east to make it neater (and might stop futur bugs):