示例#1
0
        public void attach(String pSound)
        {
            // create a new ImageHolder to hold the image
            SoundHolder pSoundHolder = new SoundHolder(pSound);

            Debug.Assert(pSoundHolder != null);

            // add to front
            SLink.AddToFront(ref this.poFirstSound, pSoundHolder);

            // set the first one to this image
            this.pCurrSound = pSoundHolder;
        }
        public override void Execute(float deltaTime)
        {
            SoundHolder pSoundHolder = (SoundHolder)this.pCurrSound.pSNext;

            if (pSoundHolder == null)
            {
                pSoundHolder = (SoundHolder)poFirstSound;
            }
            this.pCurrSound = pSoundHolder;

            SoundMan.PlaySound(pSoundHolder.pSound.name);
            TimerMan.Add(TimeEvent.Name.ScenePlaySound, this, deltaTime);
        }
        public void Attach(Sound.Name soundName)
        {
            Sound pSound = SoundMan.Find(soundName);

            Debug.Assert(pSound != null);

            SoundHolder pSoundHolder = new SoundHolder(pSound);

            Debug.Assert(pSoundHolder != null);

            SLink.AddToFront(ref this.poFirstSound, pSoundHolder);

            this.pCurrSound = pSoundHolder;
        }
示例#4
0
        //----------------------------------------------------------------------------------
        // Methods
        //----------------------------------------------------------------------------------

        public void Attach(Sound.Name soundName)
        {
            // Perhaps make a sound Manager??
            Sound pSound = SoundManager.Find(soundName);

            Debug.Assert(pSound != null);

            SoundHolder pSoundHold = new SoundHolder(pSound);

            Debug.Assert(pSoundHold != null);

            DLink.AddToEnd(ref this.poFirstSound, pSoundHold);

            this.pCurrentSound = pSoundHold;
        }
        public void Attach(SoundEngine.Name soundName)
        {
            // Get the Sound
            SoundEngine pSound = SoundEngineMan.Find(soundName);

            Debug.Assert(pSound != null);

            // Create a new holder
            SoundHolder pSoundHolder = new SoundHolder(pSound);

            Debug.Assert(pSoundHolder != null);

            // Attach it to the Animation Sprite ( Push to front )
            DLink.AddToEnd(ref this.poFirstSound, pSoundHolder);

            // Set the first one to this Sound
            this.pCurrSound = pSoundHolder;
        }
示例#6
0
        public override void Execute(float deltaTime)
        {
            Debug.Assert(deltaTime > 0);

            SoundHolder pSoundHold = (SoundHolder)this.pCurrentSound.pNext;

            // if you reached the end go back to the start
            if (pSoundHold == null)
            {
                pSoundHold = (SoundHolder)this.poFirstSound;
            }

            //set to next sound
            this.pCurrentSound = pSoundHold;

            pSoundHold.pSound.Play(0.4f);
            TimerManager.Add(TimeEvent.Name.PlaySound, this, this.pAlienGrid.movementTimeInterval);
        }
示例#7
0
        public override void Execute(float deltaTime)
        {
            // advance to next Sound
            SoundHolder pSoundHolder = (SoundHolder)this.pCurrSound.pNext;

            // if at end of list, set to first
            if (pSoundHolder == null)
            {
                pSoundHolder = (SoundHolder)poFirstSound;
            }

            // squirrel away for next timer event
            this.pCurrSound = pSoundHolder;

            // change Sound
            pSoundHolder.pSound.PlaySound();

            // Add itself back to timer
            TimerMan.Add(TimeEvent.Name.GridSoundTempo, this, deltaTime);
        }
示例#8
0
        //----------------------------------------------------------------------
        // 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);
            }
        }