The first version of the game was working fine, except for a ton of bugs of course. But this was going to be fixed later. In the meantime, I would have to think about the levels. At this point, in the existing prototype, the levels were “hard coded”. A huge image was used at the terrain, while physical zones were hand-placed. One by one. It took time, but it was actually simple to do.
However, on a long run, it wasn’t viable at all. Especially given the fact that I intended to build 80 levels. I was going to need a level editor. That would take a lot of time, but again, on a long run, I was certain it would be profitable.
My desire to get a curved universe was going to be a huge pain in the ass. I knew it. But before that, I didn’t think I was going to do everything by myself. I was going to dive deep in a nightmarish era. A traumatic era I thought I was done with, when pimples were appearing all over my face and when the simple idea of being in a room filled with girls was more than frightening. I was about to go back to high school, meet Pythagoras and Thales, again. Pit, Tale, I hate you. Best regards.
This is what a level looked like, on paper.
I had to schematize it, in order to determine which geometric function I had to use. So, it was a lot of circles, crossed by lines, drawing angles, with a lot of wrong calculations on it. I had never imagined how difficult it was going to be, for me. Besides the fact Corona SDK isn’t optimized to draw vector shapes (using Bezier curves would have been perfect for that job). I would have to cheat to get all those merged balls. And of course, I had to use those bastards Thales’ and Pythagoras theorems.
Clearly, I’ve never been good with mathematics. From high school, to college, I even had to get tutored several times. To eventually get something like a 10/20. In the end, I managed to get my bachelor degree with a pretty 6,5/20. With a major in science. Yeah, that’s right.
But, whatever the cost, I really wanted my games to be curvy. For aesthetics reasons, but also because I wanted the game to differentiate itself from what we were used to see. So, I persevered into it. I defined a file to stock level informations. The endgame was that my engine could read that file, and generate all those curves. After a long moment, XML files could be loaded and the level generation could happen, just like that:
At this point, something was still missing. Those XML files were hand written, which was too complicated. To avoid this, I was going to create my own level editor, from scratch. Because at the time (and that’s still more or less the case today), Corona SDK didn’t offer a proper interface. Instead, we just had two windows. The first one showed the compiled game, while the second one was used to debug stuffs. And that was it. There was absolutely nothing else, no interface where you could take a graphic, and put it on some scene.
A month later, spent working with Flash, the first version of my level editor was working. In a few minutes, I was then capable of building a level from zero, test it immediately and play with it.
Made with Flash, in Actionscript 1.5 (meaning : it was neither Actionscript 2, nor Actionscript 1, just some kind of a bastard, pretty ugly, even for me), this level editor would allow me to produce levels in the fastest way ever without touching any line of code. Like “What You See Is What You Get“. In reality, it was closest to “What You See Is Almost What You Get With Some Imagination“. But the levels were finally curvy, just like I wanted.
Quickly, I was able to produce levels, test them, see what should be improved. The time-saving on a long run was actually already effective. Adding gameplay items was quick too, although I would have to add more lines of code.