
Using a game framework—the fantomEngine
In Chapter 3, Game #2, Rocket commander we have created every single class and function required for our game. Sometimes we also created duplicate functionality. For example, every object had its render method. This bloats up the code of the game but it was also good to understand the concept of a whole game.
To avoid redundant coding and make your life easier, you can and will use the fantomEngine game framework for this game.
The source code file, fantomEngine.monkey
is included with this book, but for the most recent version visit: http://code.google.com/p/fantomengine/.
The fantomEngine features some classes (objects) for different functionalities, which are described as follows:
ftEngine:
This is the main engine classftObject:
An object that can be an image, text, circle, or a boxftSound:
This is to handle sound filesftLayer:
A layer groups several objects together to update, render, and check collisionsftFont:
This is a bitmap font object which can load EZGui compatible font filesftTimer:
Using this, a timer will be called at will and you can automate processes with it
In this chapter, we won't go into every feature of the fantomEngine. For a detailed reference please visit its website.