Today we are excited to welcome Matthew Hopson founder of fortheinter.net as a guest blogger. He’ll be sharing his experiences and explain how with the help of the CreateJS framework he was able to develop his first Windows 8 game: Super Slot Cars.
I love video games. I play them every day, on both my computer and my game console. I’ll play nearly any game, from story-rich adventures to detailed strategy games. Gaming is even how I learned to develop websites, by developing a website for an online gaming clan I had formed with a group of friends.
It didn’t take me long to choose CreateJS for Super Slot Cars. I never choose to use libraries easily as I usually prefer to write something myself, but CreateJS was one that quickly struck me as a no-brainer. Nearly every tutorial I came across recommended it , it appeared extremely well documented and to someone with zero experience of new HTML5 features such as canvas and audio, it instantly began to make sense.
One thing I decided from the offset was that I wanted to generate the tracks from some basic coordinates. Using a series of coordinates and rotations, with CreateJS I quickly had a track layout created. With some calculations I was able to create parallel lines across the width of the track for the slots and the trackside walls, and with a bit more effort generated the curbs in the same way. Although many of these calculations were quite complex, one thing I never had to worry about was drawing them to the canvas. It was so easy to add shapes, I ended up littering the canvas with thousands of shapes when debugging the generated coordinates!
Perhaps the one part of the game that concerned me the most going into it though was sound. I had never used sound on a website (so annoying) and I’d never got to that stage in a game before. I kept putting it off, working on other elements of the game, until I eventually had no choice but to tackle it. To be frank, I shouldn’t have worried as CreateJS again made things so easy. It really was as simple as adding a few lines to each relevant item and I had music playing, slot car sounds that varied with speed and even squeaky buttons!
My game has been released for nearly a week now on the Windows Store, and CreateJS continues to be a great choice. I read this morning that some users were having difficulty with poor performance so I began to have a think. It ran fine on my computer natively and while Visual Studio 2012’s simulator performed poorly I had put it down to it being a simulator. I quickly realised my mistake. While I had already been caching the generated track, wall and curb shapes, I had neglected to consider the impact of up to 100 bitmaps on performance. In the space of an hour everything was all fixed, thanks to CreateJS’ caching and nesting features. By grouping all of the bitmaps together and caching them using CreateJS, the game was soon performing just as well in the simulator as it was natively.
For me, Super Slot Cars simply wouldn’t have been possible to make without CreateJS. It not only made many aspects of development considerably easier than they would be normally, but it finally inspired and enabled me to do what I always wanted to do – create a game.
(Note: The patch to improve performance is in certification as of 20th March and should be made available in a few days.)
|Matthew Hopson Founder | fortheinter.net|