June 16, 2009

Taking on a Game Development Project


I just started making a flash game, my first one in a while, and my first by Cyclonic Studios. I decided that I would organize this project as well as I could. My previous games, while not being very good (you can play one here), were also terribly unorganized and I found that after I had finished them, it was very hard for me to go back and change things.


So this time, I am putting loads of effort into designing everything to be well and sensibly made. Here are some things that I am focusing on.


1. A Solid Game Idea

It is of upmost importance to know what your doing well before you start. You should know how the game is going to look, how the player is going to play the game, and how you are going to make everything work. Before you sit down at your computer and start coding away, you should make sure that you know those three things. How things will look, play, and work.


2. A Solid Game Engine

When you start coding your game, you have to decide how organized everything will be. I find that making a game engine is a good way to keep things organized. Here are a few musts for a game engine:

  • A Global Class. A Global class is great for object oriented programming and is basically a class that every single object you make has a reference to. With this in place, you can call functions and access global properties even from a remote object that couldn’t normally do these things. For instance, if the enemies in your game split into more enemies when they die, it would be useful if all you had to do was add a few lines to your enemy “die” code to add more enemies. Just a simple global.makeEnemy(blah,blah,blah); would do the trick, and also make it so that every single other instance of every other class could see that a new enemy was made.
  • A UI Class. Just a class to handle all user interface stuff. When I’m making games, I use lots of code to make my interfaces faster and easier to manage. The UI class makes code-based interfaces much simpler, because you can easily show menus, pages, etc. with just a function call. Example: ui.displayMenu(blah,blah); or ui.menu.addButton("Play",function() { play(); }); (I use that last one all the time; its surprisingly useful). And even if you don’t build most of your menus with code, a UI class also makes it easier to display menu sprites and movieclips.
  • A Display Class. When you make a game with lots and lots of sprites, movieclips and bitmaps, a single class that draws all of them makes your code much cleaner. Its especially great for people like me who don’t want all their objects extending Sprites, which takes up more memory and is, in my opinion, a shortcut. Instead, you just have one class extending a sprite, Display.as.


3. A Solid Sense of Patience

Once you’ve got your idea and your engine, its time to start making your game. I think that coding games is very enjoyable, but inevitably you’ll have some times when patience is crucial: fixing that bug, drawing this button, and doing everything else that just isn’t…well, fun.


Anyway, happy game development!