Level Director is a great 3rd party Corona SDK tool that I found through Google searches that promoted being able to handle bezier curves. I played around with the free download and felt that it would be able to handle what I needed. I payed for the full license and spent a bit of time learning the software.
Overall the software has some great strengths and does a lot of heavy lifting. Sadly a lot of it isn’t really documented adequately. I spend more time digging through their example code to learn how to do some things. I’ve even been thinking about doing some new documentation for them and giving it to them as a gift but I have yet to get around to that.
I really wanted to do some proof of concepts with the bezier curves. I quickly got something up and running (again because of how much Level Director does). I had some objects sliding up and down hills and everything was going smoothly.
The problems began when I started playing with rectangles (with sharp corners) sliding down bezier curves. The corners would randomly snag on a vertices of the bezier curve causing the rectangle to flip, which was not the desired result at all.
I spent a lot of time with the Level Director generation code and trying changing the shapes of the bezier curves and found limited success. I could never get consistent results for what I wanted. I did some digging and found box2d (which Corona SDK uses for physics) had a solution for this by using a chain object. Helpeful research links below:
- http://www.iforce2d.net/b2dtut/ghost-vertices
- http://stackoverflow.com/questions/10428943/smoothly-move-between-bodies
I reached out to Level Director (in a forum post here) and described my problem. Within a day they had given me a different version of the code that used chain edges to try with my code. I tried it and instantly the problem was resolved and the level loading was a lot faster!
I’ve continued to work with Level Director and am enjoying it. There are some parts I prefer to move to vanilla code because I need 100% consistent objects (such as joint placements on a train between levels). But for building and generating levels it has been awesome!
I really can’t say enough about how awesome Level Director is and how it made this project possible. Keep on coding!