for the 90degree slopes, try, if wormxposition = where you dont want it to go. set it back a few pixels or something like that
if x> 500 and x<502 then x = 500
basicly, that one, you can go on the x=501 line.
oh wait, all the X's need to be Y's sorry, im top lazy to change it
If LeftKey() = 1
cx# = NewXValue(cx#,WrapValue(cay#-90),5)
cz# = NewZValue(cz#,WrapValue(cay#-90),5)
EndIf
If RightKey() = 1
cx# = NewXValue(cx#,WrapValue(cay#+90),5)
cz# = NewZValue(cz#,WrapValue(cay#+90),5)
EndIf
but change the right/leftkey() =1 to the mouse x or something, and im tired, but i will tell you exactly how to do it (maybe) tomarrow after school
Two words, moo.