Game Development Reference
In-Depth Information
[Embed(source = "../../../../../assets/noTanks_assets.swf", symbol="soundGoal")]
public static const SoundGoal:Class;
[Embed(source = "../../../../../assets/noTanks_assets.swf", symbol="soundHit")]
public static const SoundHit:Class;
[Embed(source = "../../../../../assets/noTanks_assets.swf", symbol="soundMusic")]
public static const SoundMusic:Class;
[Embed(source = "../../../../../assets/noTanks_assets.swf", symbol="soundHitWall")]
public static const SoundHitWall:Class;
[Embed(source = "../../../../../assets/noTanks_assets.swf", symbol="soundLife")]
public static const SoundLife:Class;
}
}
We created all of the sounds with the SFXR tool with the exception of the music. Chapters 4 and 5
had a nice discussion of this tool. The music was created with Sony Acid, using a Magix loop library.
We saved the music as a .wav file, so it would loop properly when exported in the game SWF.
Finalizing the Level.as and Level1.as file
We created the Level.as file in the previous chapter. We need to add two new attributes to the
level-specific data.
The first new attribute is called enemyShotDelay . It represents the delay in frames between times
the enemy will fire at he player. The shorter the delay the harder the game level will be.
The second new attribute is called enemyHealthPoints . This represents the number of missile hits
an enemy can take before being destroyed by the player
This file should already be located here:
/source/projects/notanks/flexSDK/src/com/efg/games/notanks/Level.as
Add the new line for enemyShotDelay to the existing file. Here is the entire Level.as file once
again:
package com.efg.games.notanks
{
/**
* ...
* @author Jeff Fulton
*/
public class Level{
public var backGroundMap:Array;
public var spriteMap:Array;
public var backGroundTile:int;
public var enemyIntelligence:int;
public var enemyShotSpeed:Number;
public var ammoPickUp:int;
//***added in chapter 7
Search WWH ::




Custom Search