Suggestions for platform game with moving holes

Suggestions for platform game with moving holes
0

Hi all, I would like suggestions on how to achieve the following using Chipmunk physics please.

I am trying to recreate an old platform game.
The game has several “floors” with several random holes moving from left to right (>>) and right to left (<<).

       >>    <<  
-----   ----   -----
--   --------   ----
------------------

I am unsure how I would make the physics edge of the floor, and move the holes so player could fall down or jump up. I assume you can “move” the end points of physics “line” edges, but as two holes move closer and cross I’d need for edge to “disappear and reappear” as they cross. It seems very complicated to move the edges of the floor to create illusion of moving holes, rather than moving the holes. Is there some way to make a “transparent” hole in physics edge and move it?

I hope this picture makes is clearer what I am trying to do

    >>       <<                >>      <<                >>    <<                    ><                    << >>
---   -------   ---   =>   ----   -----   ----  =>  -----   ---   -----  =>  -------     -------  =>  -----   -   -------

One idea I had was to simply make the floors full physics edges, and then if I detect player is colliding with edge, but on a “hole” return false from the collision notification, effectively ignoring the edge temporarily. However, if I do this I do not think I can “knock” player sideways from edges of moving hole…or can I? Perhaps make two moving physics bodies at edge of hole (o) that I do not ignore?

---o    o---

In advance, thanks for suggestions.

There is an example of one way platforms in cpp-tests

Ah, sounds like just the thing.
Thanks slackmoehrle.