ID:145323
 
Code:
    baser
icon ='background.dmi'
icon_state="baser"
density=1
Enter()
if(usr.dir == WEST)
src.density =0
usr.loc=locate(+1,0,0)
if(usr.dir == EAST)
src.density =0
usr.loc=locate(-1,0,0)
basel
icon ='background.dmi'
icon_state="basel"
density=1
Enter()
if(usr.dir == WEST)
src.density =0
usr.loc=locate(+1,0,0)
if(usr.dir == EAST)
src.density =0
usr.loc=locate(-1,0,0)
basemiddle
icon ='background.dmi'
icon_state="basemiddle"
density=1
Enter()
if(usr.dir == WEST)
src.density =0
usr.loc=locate(+1,0,0)
if(usr.dir == EAST)
src.density =0
usr.loc=locate(-1,0,0)


Problem description:I'm currently working on a super mario game and I'm having some trouble. I am guessing that everyone here has play mario before and I was trying to make it so when mario jumps like the the hills he can walk through them. They have density so he can only really walk on the side ones and top one. Heres a picture to show what i'm talking about Image Hosted by ImageShack.us

Look up Enter() in the reference. The Enter()s you have there are utterly wrong.
You can just simply allow entrance when going up to the ledge, but deny entrance when you're trying to go down.

turf/ledge
Enter(atom/movable/A)
if(a.dir == SOUTH) return 0
return ..()


~~> Unknown Person
In response to Unknown Person
but what happens when they walk WEST and NORTH on it? The density will still remane ONE
In response to Animekid09
Think hard about what you do to take density off.
In response to Cheetoz
        icon ='background.dmi'
icon_state="baser"
density =1
Enter(atom/movable/A)
if(A.dir == SOUTH) return 0
return ..()
if(A.dir == EAST) return 0
return ..()
if(A.dir == WEST) return 0
return ..()
basel
icon ='background.dmi'
icon_state="basel"
density =1
Enter(atom/movable/A)
if(A.dir == SOUTH) return 0
return ..()
if(A.dir == EAST) return 0
return ..()
if(A.dir == WEST) return 0
return ..()
basemiddle
icon ='background.dmi'
icon_state="basemiddle"
density =1
Enter(atom/movable/A)
if(A.dir == SOUTH) return 0
return ..()
if(A.dir == EAST) return 0
return ..()
if(A.dir == WEST) return 0
return ..()


Ok This is my code now but it really dosn't do anything. The thing has no density so you can't jump on it. Its really not helping at all.
In response to Animekid09
That is because you have no idea how to use it, sigh.
In response to Mysame
What a waste of a post. The whole point of this is for people to help me fix things. Your post was nothing but a waste and did nothing at all.
In response to Animekid09
And what you posted was nothing but a copy/pasted from UP's code. Can't you even notice you're returning ..() after every direction check?
In response to Mysame
If i get rid of the return...() the density is 1 and if i add density =0 the density id still 1
In response to Animekid09
That's because you don't need to delete ALL returns. What's the point in using a code you don't understand?
And for the use of UP's code, density needs to be null, really.
Though, my 2 cents:

Enter(var/atom/movable/a)
if(ismob(a))
var/mob/m=a
if(m.dir==SOUTH) return 0
return ..()