Ejemplo n.º 1
0
        //#################################
        // LoadContent
        //#################################
        public override void LoadContent()
        {
            _stationSymbol = new UIItem();
            _stationSymbol.LoadContent("Images/station_icon", 4);
            _droneFleet.replaceOldDrone(new Vector3(150, 0, 100));
            Global.Camera = new Camera(Global.GraphicsManager.GraphicsDevice.DisplayMode.AspectRatio, 10000f, MathHelper.ToRadians(45), 1f, Global.CameraPosition, _droneFleet.GetActiveDrone().Position, Vector3.Up);
            _station.LoadContent();
            _planet.LoadContent();
            _sphere.LoadContent();
            _ui.LoadContent(_droneFleet);
            _frame.LoadContent();
            tutorialDialog.LoadContent();
            captainDialog.LoadContent();
            captain.LoadContent("Images/captain", 4);
            _asteroidField.LoadContent();
            //Sounds

            _engine = new ISpaceSoundEngine(SoundOutputDriver.AutoDetect, SoundEngineOptionFlag.LoadPlugins | SoundEngineOptionFlag.MultiThreaded | SoundEngineOptionFlag.MuteIfNotFocused | SoundEngineOptionFlag.Use3DBuffers);

            _explosionSource  = _engine.AddSoundSourceFromFile("Content/Media/Effects/Explosion.wav", StreamMode.AutoDetect, true);
            _explosionSource1 = _engine.AddSoundSourceFromFile("Content/Media/Effects/Objects/Explosion1.wav", StreamMode.AutoDetect, true);
            _explosionSource2 = _engine.AddSoundSourceFromFile("Content/Media/Effects/Objects/Explosion2.wav", StreamMode.AutoDetect, true);
            _explosionSource3 = _engine.AddSoundSourceFromFile("Content/Media/Effects/Objects/Explosion3.wav", StreamMode.AutoDetect, true);

            _openShop = _engine.AddSoundSourceFromFile("Content/Media/Effects/OkClick.wav", StreamMode.AutoDetect, true);


            Global.HighScorePoints = 0;
            Global.Money           = 0;
            Global.DroneDmg        = 10;
            Global.NumberOfRockets = 1;
            Global.SpeakerVolume   = 2;
        }
Ejemplo n.º 2
0
        public void Update(GameTime gameTime, ref AsteroidBuilder asteroidField, ref DroneBuilder droneFleet)
        {
            List <AEntity> avoidList = new List <AEntity>();

            avoidList.AddRange(asteroidField._asteroidList);
            avoidList.AddRange(droneFleet._droneShips);
            _boids.Update(gameTime, avoidList, droneFleet.GetActiveDrone());
        }
Ejemplo n.º 3
0
        //#################################
        // Draw
        //#################################
        public void Draw(DroneBuilder droneFleet)
        {
            _shields.Draw(new Point(50, Global.GraphicsManager.GraphicsDevice.Viewport.Height - 130), droneFleet._armor, new Color(1f, 1f, 1f, 0.5f));
            _rocketSymbol.Draw(new Point(355, 717), 1, new Color(1f, 1f, 1f, 0.5f));

            Global.UIBatch.Begin();
            Global.UIBatch.DrawString(Global.Font, Global.NumberOfRockets.ToString(), new Vector2(390, 725), new Color(58f, 116f, 112f));
            Global.UIBatch.End();

            Bars[0].Draw(droneFleet.GetActiveDrone().health, droneFleet.GetActiveDrone().maxHealth);
            Bars[1].Draw(droneFleet.GetActiveDrone().shield, droneFleet.GetActiveDrone().maxShield);

            /*
             * if (Vector3.Distance(this._station.Position, droneFleet.GetActiveDrone().Position) < 300)
             * {
             *  var vec = new Point();
             *  vec.X = (int)Global.GraphicsManager.GraphicsDevice.Viewport.Project(_station.Position, Global.Camera.ProjectionMatrix, Global.Camera.ViewMatrix, Matrix.Identity).X - 80;
             *  vec.Y = (int)Global.GraphicsManager.GraphicsDevice.Viewport.Project(_station.Position, Global.Camera.ProjectionMatrix, Global.Camera.ViewMatrix, Matrix.Identity).Y - 90;
             *  Bars[2].Draw(vec, _station._health, _station._maxhealth);
             *  vec.Y = (int)Global.GraphicsManager.GraphicsDevice.Viewport.Project(_station.Position, Global.Camera.ProjectionMatrix, Global.Camera.ViewMatrix, Matrix.Identity).Y - 80;
             *  Bars[3].Draw(vec, _station._shield, _station._maxShield);
             * }
             * else
             * {*/
            Bars[2].Draw(_station._health, _station._maxhealth);
            Bars[3].Draw(_station._shield, _station._maxShield);
            //}

            _scoreDialog.Draw("Score: " + Global.HighScorePoints.ToString());
            _moneyDialog.Draw("Fragments: " + Global.Money);

            float _distance = Vector2.Distance(new Vector2(droneFleet.GetActiveDrone().Position.X, droneFleet.GetActiveDrone().Position.Z), Vector2.Zero);

            if (_distance > Global.MapRingRadius && _distance < Global.MapRingRadius + 80)
            {
                _alertDialog.Draw("ALERT! OUT OF RANGE", Color.OrangeRed);
            }
            else if (_distance > Global.MapRingRadius + 80)
            {
                _alertDialog.Draw("ALERT! SHIP FAILURE", Color.Red);
            }

            if (Global.Money >= 0)
            {
                if ((Vector3.Distance(this._station.Position, droneFleet.GetActiveDrone().Position) - GameplayScreen._stationHeight) < 150)
                {
                    _upgradeVincinityDialog.Draw("Press B for Shop!");
                }
            }
        }
Ejemplo n.º 4
0
        // Event handler for when the Health menu entry is selected.
        void healthMenuEntrySelected(object sender, EventArgs e)
        {
            if (Global.Money >= _priceDroneHealth)
            {
                _droneHealthLevel++;
                Global.Money -= _priceDroneHealth;

                this._droneFleet._maxHealth += 100;
                _droneFleet.GetActiveDrone().health += 100;

                SetMenuEntryText();
                SetShopText();

                //playing the sound
                SoundEngine.Play2D("MenuAcceptSound", Global.SpeakerVolume / 10, false);
            }
            else
            {
                //playing the sound
                SoundEngine.Play2D("MenuDenieSound", Global.SpeakerVolume / 10, false);
            }
        }
Ejemplo n.º 5
0
        //#################################
        // LoadContent - Function
        //#################################
        public void LoadContent(DroneBuilder droneFleet)
        {
            //Shield
            _shields.LoadContent("Images/UI/shield_ui", 4);
            //Rocket
            _rocketSymbol.LoadContent("Images/Rocket_Icon", 4);

            //Bars
            Bars.Add(new Bar(new Rectangle(new Point(50, Global.GraphicsManager.GraphicsDevice.Viewport.Height - 80), new Point(300, 60)), Color.Red, droneFleet.GetActiveDrone().maxHealth));
            Bars.Add(new Bar(new Rectangle(new Point(50, Global.GraphicsManager.GraphicsDevice.Viewport.Height - 90), new Point(300, 60)), Color.Blue, droneFleet.GetActiveDrone().maxShield));
            Bars.Add(new Bar(new Rectangle(new Point(Global.GraphicsManager.GraphicsDevice.Viewport.Width - 400, Global.GraphicsManager.GraphicsDevice.Viewport.Height - 750), new Point(300, 60)), Color.Green, _station._maxhealth));
            Bars.Add(new Bar(new Rectangle(new Point(Global.GraphicsManager.GraphicsDevice.Viewport.Width - 400, Global.GraphicsManager.GraphicsDevice.Viewport.Height - 740), new Point(300, 60)), Color.White, _station._maxShield));
            foreach (var bar in Bars)
            {
                bar.LoadContent();
            }

            //Dialogs
            _upgradeVincinityDialog = new Dialog(Global.GraphicsManager.GraphicsDevice.Viewport.Width / 2 - 64, Global.GraphicsManager.GraphicsDevice.Viewport.Height - 82, 24, 176, 8, false, true);
            _scoreDialog            = new Dialog(260, Global.GraphicsManager.GraphicsDevice.Viewport.Height - 750, 24, 200, 8, false, true);
            _moneyDialog            = new Dialog(50, Global.GraphicsManager.GraphicsDevice.Viewport.Height - 750, 24, 200, 8, false, true);
            _alertDialog            = new Dialog(Global.GraphicsManager.GraphicsDevice.Viewport.Width / 2 - 160, Global.GraphicsManager.GraphicsDevice.Viewport.Height / 2 - 16, 24, 320, 8, false, true);

            _scoreDialog.LoadContent();
            _alertDialog.LoadContent();
            _moneyDialog.LoadContent();
            _upgradeVincinityDialog.LoadContent();
        }
Ejemplo n.º 6
0
        //#################################
        // LoadContent
        //#################################
        public override void LoadContent()
        {
            _stationSymbol = new UIItem();
            _enemySymbol   = new UIItem();
            _stationSymbol.LoadContent("Images/station_icon", 4);
            _enemySymbol.LoadContent("Images/hit_marker", 4);

            _droneFleet.replaceOldDrone(new Vector3(150, 0, 100));
            Global.Camera = new Camera(Global.GraphicsManager.GraphicsDevice.DisplayMode.AspectRatio, 10000f, MathHelper.ToRadians(45), 1f, Global.CameraPosition, _droneFleet.GetActiveDrone().Position, Vector3.Up);
            _station.LoadContent();
            _sphere.LoadContent();
            _asteroidField.LoadContent();
            _ui.LoadContent(_droneFleet);
            _frame.LoadContent();
            _waveBuilder.LoadContent();
            _planet.LoadContent();
            //Effects
            _stationEffect = Global.ContentManager.Load <Effect>("Effects/stationEffect");

            //Sounds
            //playing the sound
            _soundEngine.setListenerPosToCameraTarget();
            _soundEngine.AddSoundSourceFromFile("openShop", "Content/Media/Effects/OpenShop.wav");
            _soundEngine.AddSoundSourceFromFile("explosionSource", "Content/Media/Effects/Objects/Explosion4.wav");
            _soundEngine.AddSoundSourceFromFile("explosionSource1", "Content/Media/Effects/Objects/Explosion1.wav");
            _soundEngine.AddSoundSourceFromFile("explosionSource2", "Content/Media/Effects/Objects/Explosion2.wav");
            _soundEngine.AddSoundSourceFromFile("explosionSource3", "Content/Media/Effects/Objects/Explosion3.wav");
            _soundEngine.AddSoundSourceFromFile("astexplosionSource1", "Content/Media/Effects/Objects/ExplosionAst1.wav");
            _soundEngine.AddSoundSourceFromFile("astexplosionSource2", "Content/Media/Effects/Objects/ExplosionAst2.wav");
            _soundEngine.AddSoundSourceFromFile("astexplosionSource3", "Content/Media/Effects/Objects/ExplosionAst3.wav");
            _soundEngine.AddSoundSourceFromFile("hitSound", "Content/Media/Effects/Objects/GetHitShips.wav");

            //Global.Music = _soundEngine.Play2D("explosionSource3", Global.MusicVolume / 10, false);
            captainDialog.LoadContent();
            captain.LoadContent("Images/captain", 4);

            // X = left/right

            _soundEngine.setListenerPosToCameraTarget();
            var pos = Global.Camera.Target;

            Global.Music = _soundEngine.Play3D("explosionSource3", Global.MusicVolume / 10, Global.Camera.Target, false);
        }
Ejemplo n.º 7
0
        //#################################
        // LoadContent
        //#################################
        public override void LoadContent()
        {
            _stationSymbol = new UIItem();
            _enemySymbol   = new UIItem();
            _stationSymbol.LoadContent("Images/station_icon", 4);
            _enemySymbol.LoadContent("Images/hit_marker", 4);

            _asteroid1 = Global.ContentManager.Load <Model>("Models/asteroid");
            _asteroid2 = Global.ContentManager.Load <Model>("Models/asteroid2");
            _asteroid3 = Global.ContentManager.Load <Model>("Models/asteroid3");
            _astList.Add(new Asteroid(_asteroid1, new Vector3(250, 0, 150), 0, Vector3.Zero, 0, false));
            _astList.Add(new Asteroid(_asteroid2, new Vector3(350, 0, 150), 0, Vector3.Zero, 0, false));
            _astList.Add(new Asteroid(_asteroid3, new Vector3(450, 0, 150), 0, Vector3.Zero, 0, false));

            foreach (Asteroid ast in _astList)
            {
                ast.LoadContent();
            }

            _effectList.Add("Simple Explosion");
            _effectList.Add("Ship Explosion");
            _effectList.Add("Bomb Explosion");


            _dialog = new Dialog(Global.GraphicsManager.GraphicsDevice.Viewport.Width - 380, Global.GraphicsManager.GraphicsDevice.Viewport.Height - 100, 70, 360, 8, false, true);
            _dialog.LoadContent();

            _droneFleet.replaceOldDrone(new Vector3(150, 0, 100));
            Global.Camera = new Camera(Global.GraphicsManager.GraphicsDevice.DisplayMode.AspectRatio, 10000f, MathHelper.ToRadians(45), 1f, Global.CameraPosition, _droneFleet.GetActiveDrone().Position, Vector3.Up);
            _station.LoadContent();
            _sphere.LoadContent();
            _asteroidField.LoadContent();
            _ui.LoadContent(_droneFleet);
            _frame.LoadContent();
            _waveBuilder.LoadContent();
            _boidBuilder.LoadContent();
            _planet.LoadContent();
            //Effects
            _stationEffect = Global.ContentManager.Load <Effect>("Effects/stationEffect");

            //Sounds
            //playing the sound
            _soundEngine.setListenerPosToCameraTarget();
            _soundEngine.AddSoundSourceFromFile("openShop", "Content/Media/Effects/OpenShop.wav");
            _soundEngine.AddSoundSourceFromFile("explosionSource", "Content/Media/Effects/Objects/Explosion4.wav");
            _soundEngine.AddSoundSourceFromFile("explosionSource1", "Content/Media/Effects/Objects/Explosion1.wav");
            _soundEngine.AddSoundSourceFromFile("explosionSource2", "Content/Media/Effects/Objects/Explosion2.wav");
            _soundEngine.AddSoundSourceFromFile("explosionSource3", "Content/Media/Effects/Objects/Explosion3.wav");
            _soundEngine.AddSoundSourceFromFile("astexplosionSource1", "Content/Media/Effects/Objects/ExplosionAst1.wav");
            _soundEngine.AddSoundSourceFromFile("astexplosionSource2", "Content/Media/Effects/Objects/ExplosionAst2.wav");
            _soundEngine.AddSoundSourceFromFile("astexplosionSource3", "Content/Media/Effects/Objects/ExplosionAst3.wav");
            _soundEngine.AddSoundSourceFromFile("hitSound", "Content/Media/Effects/Objects/GetHitShips.wav");

            //Global.Music = _soundEngine.Play2D("explosionSource3", Global.MusicVolume / 10, false);
            captainDialog.LoadContent();
            captain.LoadContent("Images/captain", 4);

            // X = left/right

            _soundEngine.setListenerPosToCameraTarget();
            var pos = Global.Camera.Target;

            Global.Music = _soundEngine.Play3D("explosionSource3", Global.MusicVolume / 10, Global.Camera.Target, false);
        }