public Player(Game1 game, Vector3 p, float s) : base(game) { this.game = game; MAX_SPEED = 10; theModel = game.Content.Load<Model>("Models\\Player\\ship"); player_position = p; scale = s; funnelSmokePlume = new SmokePlumeParticleSystem(game, game.Content); funnelSmokePlume.DrawOrder=4; game.Components.Add(funnelSmokePlume); explosion = new ExplosionParticleSystem(game, game.Content); explosion.DrawOrder = 4; explosionSmoke = new ExplosionSmokeParticleSystem(game, game.Content); explosionSmoke.DrawOrder = 4; playerSfx = game.getSoundPlayer(); trainSoundCue = playerSfx.getCue("trainsSound"); playerSfx.playCue(trainSoundCue); trainSoundCue.SetVariable("TrainSpeed", 0); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { intro = new Intro(this); level1 = new Level1(this); level2 = new Level2(this); levels = new Queue<ILevel>(); levels.Enqueue(intro); //levels.Enqueue(level1); levels.Enqueue(level2); currentLevel = levels.Dequeue(); Components.Add(currentLevel); options = new Options(); musicEngine = new MusicPlayer(this, "Content//Sound//Music//music", 0); //extensions are purposly missed off and are autmatically added by the MusicPlayer class soundEngine = new SoundPlayer(this, "Content//Sound//Sound//Sounds"); healthMeter = new HealthMeter(this); healthMeter.DrawOrder = 10; Components.Add(healthMeter); scoreMeter = new Score(this); scoreMeter.DrawOrder = 10; Components.Add(scoreMeter); base.Initialize(); }