GAM456-SpaceInvaders / SpaceInvaders / 3_Timer / Commands / AnimateUFO.cs
AnimateUFO.cs
Raw
using System;
using System.Diagnostics;


namespace SpaceInvaders
{
    public class AnimateUFO : Command
    {
        public override void Execute(float deltaTime)
        {
            //Find UFO Obj & move it
            GameObject pUFO = ObjectNodeMan.FindObject(GameObject.ObjectName.UFORoot);
            pUFO.Move(3.0f, 0.0f);

            //Play UFO Sound
            if (!SoundManager.IsPlaying("ufo_lowpitch.wav"))
            {
                SoundManager.Play("ufo_lowpitch.wav");
            }

            //add event back to man
            TimerEventMan.AddEvent(TimerEvent.EventName.AnimateUFO, this, deltaTime);
        }
    }
}