pinball collision of two roads

Hi, I saw a video on youtube (http://www.youtube.com/watch?v=0k3mOUkQZww) in pinball sometimes have elevated roads, the question is how to control collisions on the roads as video.

I use cocos2d and box2d.
Hello!

I made that prototype/video. It's always fun when someone discovers your work and wants to know more.

Well, what I do is fairly simple. The ramps that are elevated have different categoryBits than the other parts of the world. And when I want to move the ball on / off the ramp, I deal with that with a collisionhandler which triggers when the ball touches some edges I've placed around - I basically change the maskBits/categoryBits of the ball.

The world defaults to having categoryBits = 1;
The ramps have categoryBits = 2;
And there's a part of the ramps where the ball is "moving on/off the ramp" is set with categoryBits = 3; ... so that the ball will collide with those parts both when it's on and off the ramp.

I used an early version of iforce2d's editor to create the world map, and did all the other work in C++.

I just put the source on github; https://github.com/kvisle/pinball-prototype

Original thread: https://box2d.org/forum/viewtopic.php?t=8956