A new FirefoxOS book about Game Development

:: mozilla, gsoc, gamedev, firefoxos, english

By: Andre Alves Garzia

![Book Cover](/img/old//images/gsoc/book_cover.jpg)

A new book focused on Game Development

I am almost reaching the point where I can almost release the book. My idea is to release it as an early unfinished preview and allow readers to send feedback and enjoy it while I am still building it.

The Google Summer of Code is all about open source creations and its my belief that open source should also be open development so by releasing this book in early form I am able to invite you all to contribute to it.

In this book we go from zero to a game in the Firefox Marketplace. The game we’ll build is called Foxnoid and right now it looks like this:


Pardon me for the 8fps animated gif. The actual game runs quite smooth.

In the book we’ll touch topics about game design, hanlding different types of input such as touch, gamepads and keyboard, level design and more.

Right now the book and the game are incomplete but I wanted to share my progress with you anyway.

The Game & The Framework

The Game

Our game will be the classic game where the player controls a paddle and use it to bounce balls at blocks that are floating on the top part of the screen. Once a block is hit by the ball it ceases to exist. When the player clears the screen of blocks he or she will advance to the next level and deal with a new configuration of blocks.

We believe this is a great game to learn game design and implementation from mostly because the general mechanics are easy to understand and implement. Ever since the advent of Pong we’ve had this compulsion of bouncing square balls with poorly designed paddles.

Foxnoid will allow us to present a complete game dealing with fast moving graphics, different levels, player progression, game states and more. Even though it is a simple game it allows us to explore many of the common tasks that most game developers face on their own creations.

The Framework

The plan is to implement Foxnoid for Firefox OS first and then adapt it to other platforms. To do this we’re going to adopt a game development framework called Phaser. Many readers are now probably asking why am I adopting a framework instead of working with raw Javascript and the answer to that is that this book is called Developing Games for Firefox OS and not Developing Game Engines for Firefox OS.

Imagine if you picked up a cooking book and it begun like: “first find some land with good rainfall and seeds for all the vegetables you will need…”. Teaching games development thru building game engines is like planning a road trip by first constructing your own car. In the end it might be a delightful adventure but its not what we’re aiming for here.

If we opted to without a framework or library we would need to teach you all about bliting images to the screen and converting keycodes into usable input information and more. We would lose too much time on trivia that has been solved before and once you could do all that you would still need to implement your own game.

Building game engines with good performance and usability is a very difficult job. You can create very good games with just raw Javascript calls but most game designers will not always start from a blank sheet. The ones that are not using some framework or library will develop their own and then stick to it.

I am not against developing your own framework but if we did this here then in the end you would be coding your game using my own framework that would not be as good as Phaser because those folks know much more than I do about game engines. Instead of reinventing the wheel and doing a poor job when comparing it to the current wheels on the market we opted to choose a fine free and open source wheel called Phaser.

Be aware that this is not a book to teach you Phaser. We’re just using Phaser to teach you game design concepts and implement a game project. You could easily adapt our content to other frameworks or write your own engine. We are building a shelf with a hammer called Phaser, like all shelfs once it is built no one asks the name of the hammer. Yet, Phaser is the best hammer we found.

Where to get it?

Like the previous book — The Quick Guide For Firefox OS Development — this book will also be distributed using Leanpub.

The official homepage for the new book is Building Games For Firefox OS at Leanpub. By going there now and registering your interest you will kept informed of the advances as they happen. You can also follow me on Twitter or add the RSS feed for this blog to your reader as well.

Where to follow my progress

This blog is where I will document the Summer of Code progress. Our code and book will be pushed to firefoxos-gamedev Github Organization Account.

My Twitter account is @soapdog and my personal Github account is soapdog

I hope you all like our project and I am always looking for feedback (and pull requests).

Comments? Questions? Feedback?

You can reach out to me on Twitter, or Mastodon, or Secure Scuttlebutt