Game Development Reference
In-Depth Information
Game objective:
You are a lone space Marine left trying to find your way home through
a never-ending series of 360-degree scrolling mine fields.
Gameplay:
The player must fly a ship through the 360-degree scrolling world and blast
all of the mines on each level to progress to the next.
Level progression:
Levels progress with simple calculations that increase the number
and speed of the mines. There will be ten levels. The background color and color of the
mines will change on each level.
And these are the basic technical design specifications:
World size:
800
800 (no tiles)
Camera size
: 400
400
Scrolling type:
Screen-based to
BitmapData
canvas
User control:
Player will follow the mouse with automatic firing
Asset format:
Vectors cached to arrays of
BitmapData
(or single
BitmapData
instances)
Game development concepts in this chapter
In this chapter, we will cover the following:
Managing garbage collection
Optimizing render speed optimization
Optimizing memory consumption
Creating a time-base step timer with render profiling
Adding a frame rate timer to the framework
Drawing vector assets in code
Caching vector assets into arrays of
BitmapData
for rendering
Optimized Screen-based scrolling on
BitmapData
canvas with
ScrollRect
Using the power of
BitmapData
to create a simple radar screen
Using look-up tables
Creating a simple particle engine
Pooling objects
Modifying the game framework
We are going to add the following functionality to our ever-evolving game framework:
Mute functionality
: This will be controlled by
Main
and will trigger a new function inside
the
SoundManager
class.
Pause functionality
: This will be implemented in
GameFrameWork.as
and will be
available only to games that use the time-based step timer created in this chapter. We
have done this so the
GameFrameWork
file will remain compatible with all of the games
previously created with the standard timer.