I think the last time I made a real game, one that people play and get points etc, was over a decade ago. At the time there were no gaming frameworks, we just created these little web games the best way we knew how.
Today, the games are so much more sophisticated and while I’ve had a burning desire to create little games for smartphones and tablets, I’ve also been intimidated by the new tools and complexities involved.
Making games can be a scary prospect when you don’t have friendly and familiar tools at hand.
As I dove (and continue diving) into the Citrus Engine framework, I am amazed at how much it has made Flash into a whole different tool for me. For this exercise I have been using it as a level designer – it let me lay out my test map (which is just a vector image I created in illustrator) and also let me place some simple boxes that will become physics bodies in the game, so the probes can bounce off the edges of the map.
After spending many years writing code to put stuff on the screen, to be back in Flash and just making simple boxes and positioning them felt like playing! It let me concentrate on the visual layout, not the code that would handle the visual layout. I could just draw, quickly export the file and do a test build to see exactly how the placed items would work.
The speed at which things were coming together was astonishing to me! I could not get this far, this fast, without the Citrus Engine, thats for sure!
The little blue square up there, and the other bright green ones? Those are the main character the player controls and the others are little triggers to open doors and such. I just place them, define a little property and viola, your character appears where you wanted.
This part was a real revelation! It has totally eliminated so many steps in the workflow and just makes things happen in such a magical way.
I quickly threw together a little blinking animation, to mimic what Andrew Shouldice had in his original Ludum Dare entry. What was neat about his step is that I did some plain ole timeline animation in Flash, and at runtime, the Citrus Engine takes this and dynamically creates a texture atlas and xml and then plugs it all in!
Again, I made some tweaks to the engine to allow it to let me export my animations in SWC format and just reference those Movie Clip instances (dynamically converted to Starling MovieClips) and it’s all amazingly seamless and quick.
So after a couple of days on the weekend and a few late nights, I had something that resembled the core mechanic of the game.
Some of the magic is really impressive: the map automatically gets broken into tiles and placed in a sprite sheet and then reassembled as you originally placed it. I added a grid background and one little property change gave it this really nice parallax effect (this isn’t in the original game I am copying, but I think its cool!).
I made a few tweaks to the the Citrus Engine code itself after I realized that some of the elements I created were eating up hundreds of megabytes of GPU memory on my iPhone and it would quickly crash. I found an optimization that reduced memory by 600%! Now things were working again (I’ve contributed all my tweaks back to the Citrus Engine project, so anyone else can benefit and improve on it).
Below is an early version of the exercise so far. Use your arrow keys and fly around and hit things. I added a little particle effect trail for good measure 😉 (Be sure you have the most up-to-date Flash player to see this in action).