First, tell us what you think about how to get to the solution and we can go from there. Seriously, we can give you code all day, every day, but if you dont understand it you wont ever release a game or worse you will release a buggy pile of cr*p and wont be able to fix it.
Code I don’t expect. Some general ideas of how to approach the problem??
For instance, and this will be nonsense, make each portion of the tunnel body a sprite from a png, attached a physics body and then scroll using a scrollview…
I think @grimfate would be good with ideas here. If it were me, I couldn’t be using a sprite at all for section tunnels, but that is just me. I’ll think about this a bit and post my thoughts
making each portion of tunnel body a sprite from a png, attach physics and scroll using parallax node. Is actually a pretty good idea. its cheap and can be easily managed.
Hi,
we made game for our client called Curve Line, its similar to your idea.
Download here for Android : Game Link
We created 16 predefined road shapes, taken predefined points for each shapes. After that we are giving that polygon as runaction (cpp-test will help you).
Created our algo such a way that each shape can be put as 0, 90 or -90 degree, so at runtime we put random shapes and attach to old shapes and game goes infinite.
Video Trailer:
Look at this another game,
I liked this game 2.5 year back, yeah that back and still remembered this game.
Just pointing you out, play this both game and create your own code.
I dont know your final goal but i hope this will help you.