public override void Notify() { // Debug.WriteLine(" Snd_Listener: {0} {1}", this.pSubject.pObjA, this.pSubject.pObjB); Debug.WriteLine("Missile Hit Alien Sound"); SoundMan.Play(Sound.Name.Snd_Explosion); }
public override void execute(float deltaTime) { UFOMan.ActiveUFO(); SoundMan.Play("ufo_lowpitch.wav"); UfOBomb pUFOBomb = new UfOBomb(); TimerMan.Add(TimeEvent.Name.UFOBombAnination, pUFOBomb, UFOMan.getShootTime()); }
public override void shootMissile(Ship pShip) { Missile pMissile = ShipMan.ActivateMissile(); pMissile.setPos(pShip.x, pShip.y + 20); SoundMan.Play("shoot.wav"); // switch states this.handle(pShip); }
//---------------------------------------------------------------------- // Override Abstract methods //---------------------------------------------------------------------- public override void execute(float deltaTime) { // get next image ImageHolder pImageHolder = (ImageHolder)this.pCurrImage.pNext; SoundHolder pSoundHolder = (SoundHolder)this.pCurrSound.pNext; // if at the end of the list, set first image back if (pImageHolder == null) { pImageHolder = (ImageHolder)this.poFirstImage; } if (pSoundHolder == null) { pSoundHolder = (SoundHolder)this.poFirstSound; } this.pCurrImage = pImageHolder; this.pCurrSound = pSoundHolder; // change image this.pGameSprite.swapImage(pImageHolder.getImage()); SoundMan.Play(pSoundHolder.getSound()); // Add itself back to TimerMan if (this.pGameSprite.getName() == GameSprite.Name.Squid) { TimerMan.Add(TimeEvent.Name.SquidAnimation, this, deltaTime); } else if (this.pGameSprite.getName() == GameSprite.Name.Crab) { TimerMan.Add(TimeEvent.Name.CrabAnimation, this, deltaTime); } else if (this.pGameSprite.getName() == GameSprite.Name.Octopus) { TimerMan.Add(TimeEvent.Name.OctopusAnimation, this, deltaTime); } }
//------------------------------------------------------------------------------- // Override abstract methods //------------------------------------------------------------------------------- public override void notify() { SoundMan.Play(this.soundPath); }
public override void Update() { // Add your update below this line: ---------------------------- //----------------------------------------------------------- // Sound Update - place here: //----------------------------------------------------------- //--------------------------------------------------------------------------------------------------------- // Font Experiment //--------------------------------------------------------------------------------------------------------- Font pTestMessage = FontMan.Find(Font.Name.TestMessage); Debug.Assert(pTestMessage != null); pTestMessage.UpdateMessage("dog " + count++); // walk through all objects and push to proxy GameObjectMan.Update(); // Do the collision checks ColPairMan.Process(); //----------------------------------------------------------- // Sound Experiments //----------------------------------------------------------- // Adjust music theme volume Sound tmpSnd = SoundMan.Find(Sound.Name.Snd_Theme); float vol = tmpSnd.GetVolume(); if (vol > 0.30f) { vol_delta = -0.002f; } else if (vol < 0.00f) { vol_delta = 0.002f; } tmpSnd.SetVolume(vol + vol_delta); InputMan.Update(); // Load by file missileCount++; if (missileCount == 200) { missileCount = 0; // play one by file, not by load SoundMan.Play(Sound.Name.Snd_Shoot); } //// Trigger already loaded sounds //if (pMissile.y > 500.0f || pMissile.y < 100.0f) //{ // pMissile.speed *= -1.0f; // switch (count%4) // { // case 0: // SoundMan.Play(Sound.Name.Snd_HitWall); // break; // case 1: // SoundMan.Play(Sound.Name.Snd_Explosion); // break; // case 2: // SoundMan.Play(Sound.Name.Snd_UFO1); // break; // case 3: // SoundMan.Play(Sound.Name.Snd_UFO2); // break; // default: // Debug.Assert(false); // break; // } //} // Fire off the timer events TimerMan.Update(this.GetTime()); GameObjectMan.Update(); //Debug.WriteLine("\n------------------------------------"); ColPairMan.Process(); }