Game Development Reference
In-Depth Information
Size: 600
400
FPS : 40
Flex Asset Location : src/com/efg/games/colordrop/assets
For Flash, be sure to use Main.as as the document class for the FLA.
Adding this game's assets to the library
This game does not require a lot of assets. We will embed the assets in the same way as
previous games in this topic. Flash assets are stored in the FLA library. Flex assets are stored in
the assets.swf file included in the project.
Adding sounds
We only need a few sounds for this game. We are not going to make any significant change to
the SoundManager either, so we will simply list the sounds that we are going to make use of for the
game. All of these sounds were made with SFXR:
SoundClick : Plays when the player clicks a block
SoundBonus : Plays when a set of blocks disappears from the screen
SoundLose : Plays when the player loses the game
SoundWin : Plays when the player finishes a level
Adding graphics
We only have one sprite sheet for this game, and it is very simple. It includes seven 32
32-pixel
colored blocks that we will cut apart in code to create the blocks the player will click in the game;
the tile sheet is shown in Figure 8-2. We could have made this even simpler, with one block that
we recolored in code, and the tradeoff would be more code to manage the colors. When
programming gets down to this level of detail, it's really up to you as the programmer to decide
which method is best for your development efforts.
Figure 8-2. Tile sheet for Color Drop game
Defining the classes for Color Drop
Before we get into the code, let's briefly discuss the set of classes we will create for Color Drop:
ColorDrop : This is the main game class for ColorDrop . It will be called from Main and
extend from com.efg.framework.Game .
Block : This class will represent all of the on screen blocks for ColorDrop . The blocks will
all use the same tile sheet for display.
Search WWH ::




Custom Search