Example #1
0
        public void Win()
        {
            _music.Pause();
            Status = ShooterStatus.Win;
            ShowMessage(_winMessage);

            pendingTimers.Add(
                Window.SetTimeout(delegate()
            {
                UpdateMessage("<p>Press a key to continue.</p>");
            }, 3000));
        }
Example #2
0
 public void Crash()
 {
     _music.Pause();
     Status = ShooterStatus.Fail;
     Meteor.Ship.StartAnimation("Crash");
     BaseSpeed = 0;
     ShowMessage(_failMessage);
     pendingTimers.Add(Window.SetTimeout(delegate()
     {
         UpdateMessage("<p>Press a key to continue.</p>");
     }, 3000));
 }
Example #3
0
        protected override void Init()
        {
#if DEBUG
            if (Current != null)
            {
                throw Exception.Create("Cannot have more than one ShooterLevel running at the same time!", null);
            }
#endif
            pendingTimers = new List <int>();

            if (jQuery.Browser.Mozilla)
            {
                _music = LoadAudio("Audio/boss.ogg");
            }
            else
            {
                _music = LoadAudio("Audio/boss.mp3");
            }

            Current          = this;
            Status           = ShooterStatus.Starting;
            BaseSpeed        = 0.05f;
            _backgroundImage = LoadImage("Images/shooter/bg.png", false);
            AddSystem(new CloudSystem());
            AddSystem(Meteor    = new MeteorSystem());
            AddSystem(Buildings = new BuildingSystem(700, _length, 3));
            AddSystem(Dinos     = new DinosSystem(_length));
            AddSystem(_weapons  = new WeaponsSystem());
            AddSystem(Plasma    = new PlasmaSystem());
            AddSystem(Bonus     = new BonusSystem());

            ShowMessage(_startMessage);
            Window.SetTimeout(delegate()
            {
                HideMessage();
                Status = ShooterStatus.Running;
                _music.Play();

                _music.AddEventListener("ended", delegate(ElementEvent e) { _music.Play(); }, false);
            }, 3000);
        }
Example #4
0
        protected override void Init()
        {
            #if DEBUG
            if (Current != null) throw Exception.Create("Cannot have more than one ShooterLevel running at the same time!", null);
            #endif
            pendingTimers = new List<int>();

            if (jQuery.Browser.Mozilla)
                _music = LoadAudio("Audio/boss.ogg");
            else
                _music = LoadAudio("Audio/boss.mp3");

            Current = this;
            Status = ShooterStatus.Starting;
            BaseSpeed = 0.05f;
            _backgroundImage = LoadImage("Images/shooter/bg.png", false);
            AddSystem(new CloudSystem());
            AddSystem(Meteor = new MeteorSystem());
            AddSystem(Buildings = new BuildingSystem(700, _length, 3));
            AddSystem(Dinos = new DinosSystem(_length));
            AddSystem(_weapons = new WeaponsSystem());
            AddSystem(Plasma = new PlasmaSystem());
            AddSystem(Bonus = new BonusSystem());

            ShowMessage(_startMessage);
            Window.SetTimeout(delegate()
            {
                HideMessage();
                Status = ShooterStatus.Running;
                _music.Play();

                _music.AddEventListener("ended", delegate(ElementEvent e) { _music.Play(); }, false);
            }, 3000);
        }
Example #5
0
        public void Win()
        {
            _music.Pause();
            Status = ShooterStatus.Win;
            ShowMessage(_winMessage);

            pendingTimers.Add(
            Window.SetTimeout(delegate()
            {
                UpdateMessage("<p>Press a key to continue.</p>");
            }, 3000));
        }
Example #6
0
 public void Crash()
 {
     _music.Pause();
     Status = ShooterStatus.Fail;
     Meteor.Ship.StartAnimation("Crash");
     BaseSpeed = 0;
     ShowMessage(_failMessage);
     pendingTimers.Add(Window.SetTimeout(delegate()
     {
         UpdateMessage("<p>Press a key to continue.</p>");
     }, 3000));
 }