Game Development Reference
In-Depth Information
public var isSoundTrack:Boolean;
public function CustomEventSound(type:String,name:String,
isSoundTrack:Boolean=false, loops:int=0,offset:Number=0,
volume:Number=1, bubbles:Boolean=false,cancelable:Boolean=false) {
super(type, bubbles, cancelable);
this.name = name;
this.loops = loops;
this.offset = offset;
this.volume = volume;
this.isSoundTrack = isSoundTrack;
}
public override function clone():Event {
return new CustomEventSound(type, name,isSoundTrack,loops,offset,
volume,bubbles,cancelable)
}
public override function toString():String {
return formatToString(type, "type", "bubbles", "cancelable",
"eventPhase",name,isSoundTrack,loops,offset,volume);
}
}
Now, we have completed a fully functional SoundManager to add to the game framework and to
use with our games. Flak Cannon might not use all of the functionality we have created, but we
have finished this class so that it will be ready for more complicated uses of sound as this topic
progresses.
Creating difficulty with settings
Tuning the difficulty level of a game can be a very time-consuming process, and there are many
ways to tackle the problem. In this game, we will use a method that was proposed to us by Rob
Fulop in an impromptu game design class. Fulop was a programmer for the classic Atari VCS; he
coincidentally programmed the Atari VCS version of Missile Command but is best known for the
game Demon Attack, widely regarded as one of the best Atari VCS games ever made.
Fulop's suggestion was to make as many knobs as possible that you could use to turn up and
down different parts of the game to suit your needs. Since we will not actually making physical
knobs, we refer to them as settings. These settings can come in many forms, but for this game,
they will be simple numerical variables, updated when a new level is created, that we will plug
into our game code.
Difficulty settings
We will implement these settings as a group of variable tests that use to update set values for the
current level of the game. Most of these difficulty settings use the following shortcut if:then
format:
value = test:? true expression: false expression
Search WWH ::




Custom Search