Thursday, April 12, 2012

History of RaptorGL, my pet project Part 1

The Birth of RaptorGL
It all started back in 2008 with a need for a project I was working on. A client needed an animation for their corp. intranet site.  Since their network blocks flash they were looking for an alternative. So I created a simple DOM based animation with a bunch of div's and the images set as their background. It worked great and everyone was happy. The implementation wasn't the prettiest, but it worked and I did not have to worry about other javascript code getting in the way.

But something was really intriguing about it that I could just use a browser and some divs and animate it with Javascript. A Love Affair started...

So I decided to spend a weekend and experiment on how I could improve it and make it modular to be able to reuse it. I decided that the first thing I have to do is move away from DOM and use the Canvas. Thanks to lots of articles on the internet it was a quick and painless move. Once I got a working copy of the same lib using canvas I started to refactor the code and put it into it's own namespace. I had to come up with a name and Javascript Animation and Game Studio was born, or jsAGS for short. The empty repo is still on Launchpad and I'll leave it over there for historic reasons :)
I was changing it so rapidly and breaking compatibility with previous versions that I decided not to make the code public. Didn't want any angry users.

Over the years I added a lot of great functionality inspired mostly by PyGame. My 2 favorites are SpriteGroup and Surface

SpriteGroup allows you to group related sprites into one object, like bullets. Which is really cool because each update the game loop needs to call updates only on the SpriteGroup and not on every bullet sprite. Then the SpriteGroup can loop through the array of sprites and update them as needed.

Surface allows you to prototype a game or animation without any image. It supports simple shapes like rectangle, circle, and triangle. This gave a Huge boost to development and as far as the Sprite is concerned it's an image, so when the dev is ready he can just swap the surface out with an image.

Development stagnated in 2010 and it I stopped using it altogether due to lack of time. Last year in 2011 the interest sparked again to write some simple games we can play in the browser. I quickly polished off my code and it was used as the basis of this new project. 

I was unhappy with the name so a friend and I were brain storming on it, after many choices I came up with Raptor. Basing it off of movies I liked how smart they were, agile, and fast. So Raptor Game Library or RaptorGL was born.

We were rapidly working through the code and iterated lots of changes. I was writing the core code and he was writing examples/tests for each feature. We made good progress but then again life and work got in the way. By August I was the only one committing to the code base and RaptorGL became a single developer project again. Then I lost interest again...


So if you haven't yet, take a look at the RaptorGL website and spread the word.