Inheritance: Vtj.Gaming.GameSystem
示例#1
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);
        }
示例#2
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);
        }