ID:417924
 
(See the best response by DarkCampainger.)
i am trying to make a system which allows user to jump when they bump into an obstacle but cant figure out any one can help?
Are you using forum_account's pixel movement or Sidescroller?
mob
bump()
..()
if(can_jump())
jump()

Something like that.
No its entirely mine code using byond built in pixel movement and I think you didn't got what I am trying to do I am trying to make that if user bump into densed turf they will jump over it something like pokemon
Yeah, he got what you wanted. I recommend using forum_account's Pixel Movement library. It handles this for you, and all you have to do is write the code Kaiochao mentioned above.
Best response
One method to do this in the "Pokemon style" ridges where they don't actually have a third-dimension to "jump" within is to simply play a "hop" animation. You can also use Enter() to determine if they're approaching from the correct direction like in Pokemon.

Here's an example implementation. You were rather vague, so I took some liberties:
turf
Ridge
name = "Ridge"
icon = 'Ridges.dmi'
density = 0 // We use Enter() to manually control density

Entered(atom/movable/A,atom/oldLoc)

if(istype(A,/mob))
// Play the jumping animation for players
flick("hop", A)

spawn(1)
// Try to step them over the ridge
var/direction = get_dir(oldLoc, src)
var/success = step(A, direction)

if(!success)
// If it fails (something in the way), send them back
A.Move(oldLoc, direction)

Directional
icon_state = "directional"
North/dir = NORTH
South/dir = SOUTH
East/dir = EAST
West/dir = WEST

// Make this turf enterable from only one direction
Enter(atom/movable/A, atom/oldLoc)

// Check they're coming from the right dir
if(get_dir(oldLoc, src) != src.dir)
return 0 // Block entry

// Do the standard checks for dense objects
return ..()