ID:177528
 
How can I make it so when I press up, if the usr is next to an item, it puts them on top of it. So far I have:
atom/movable
        var
                item = /obj
mob
        icon = 'player.dmi'
        icon_state = "left"
client
        Northwest()
                return
        Northeast()
                return
        Southwest()
                return
        Southeast()
                return
        North()
                if(usr.x == item.x - 1 || usr.x == item.x +1)
                        usr.x = item.x, usr.y += item.y
        East()
                if(usr.icon_state == "right")
                        step(usr,EAST)
                if(usr.icon_state == "left")
                        usr.icon_state = "right"
                        step(usr,EAST)
        West()
                if(usr.icon_state == "left")
                        step(usr,WEST)
                if(usr.icon_state == "right")
                        usr.icon_state = "left"
                        step(usr,WEST)
turf
        background
                icon = 'background.dmi'
        wall
                icon = 'wall.dmi'
                density = 1
        block
                icon = 'block.dmi'
                density = 1
world
        turf = /turf/background

thanx
DiZzyBonne
You haven't specified what block is. Anyway, to do this, you have to have...

var/obj/O = locate(usr.x+1,usr.y,usr.z)
var/obj/O2 = locate(usr.x-1,usr.y,usr.z)
if(O)
if(istype(O,/obj/block))
usr.Move(O.x,O.y+1,O.z)
else if(O2)
if(istype(O2,/obj/block))
usr.Move(O2.x,O2.y+1,O2.z)
else usr.Jump()
In response to Garthor
Garthor, I don't really know how to implement that into my code. Here is my whole code.
atom/movable
        var
                item = /obj
mob
        icon = 'player.dmi'
        icon_state = "left"
client
        Northwest()
                return
        Northeast()
                return
        Southwest()
                return
        Southeast()
                return
        North()
                if(usr.x == item.x - 1 || usr.x == item.x +1)
                        usr.x = item.x, usr.y += item.y
        East()
                if(usr.icon_state == "right")
                        step(usr,EAST)
                if(usr.icon_state == "left")
                        usr.icon_state = "right"
                        step(usr,EAST)
        West()
                if(usr.icon_state == "left")
                        step(usr,WEST)
                if(usr.icon_state == "right")
                        usr.icon_state = "left"
                        step(usr,WEST)
obj
        block
                icon = 'block.dmi'
                density = 1
turf
        background
                icon = 'background.dmi'
        wall
                icon = 'wall.dmi'
                density = 1
world
        turf = /turf/background

DiZzyBonne
In response to DiZzyBonne
just check out the side scrolling demo, i don't remember who made it though.
yeah, it's a pretty good demo too. check it out.