Example #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (PrimalDevistation game = new PrimalDevistation())
     {
         game.Run();
     }
 }
        public PrimalDevistation()
        {
            _instance           = this;
            _graphics           = new GraphicsDeviceManager(this);
            _content            = new ContentManager(Services, @"Resources");
            this.IsMouseVisible = true;
            _graphics.PreferredBackBufferWidth  = 1024;
            _graphics.PreferredBackBufferHeight = 768;
            //_graphics.MinimumPixelShaderProfile = ShaderProfile.PS_3_0;
            //_graphics.MinimumVertexShaderProfile = ShaderProfile.VS_3_0;

            // Create the console
            _console           = new cConsole(this);
            _console.DrawOrder = 90000;
            Components.Add(_console);

#if !XBOX
            // Create the debug mode object
            _debugComp = new cDebugMode(this);
            _console.AddCommand("debug", "toggles whether debug mode is active or not", delegate { _debugComp.Enabled = !_debugComp.Enabled; _debugComp.Visible = !_debugComp.Visible; });
            _debugComp.Enabled   = true;
            _debugComp.Visible   = true;
            _debugComp.DrawOrder = int.MaxValue - 1;
            Components.Add(_debugComp);
#endif

            _level           = new cLevel(this, 1, 1);
            _level.DrawOrder = 100;
            Components.Add(_level);

            _weapons           = new cWeaponFactory(this);
            _weapons.DrawOrder = 600;
            Components.Add(_weapons);

            _playerManager           = new cPlayerManager(this);
            _playerManager.DrawOrder = 900;
            Components.Add(_playerManager);

            // Create the particle system

            cPhysicsParticles360 parts1 = new cPhysicsParticles360(this);
            _physicsParticles = parts1;
            parts1.DrawOrder  = 700;
            Components.Add(parts1);


            //cPhysicsParticlesCPU parts2 = new cPhysicsParticlesCPU(this);
            //_physicsParticles = parts2;
            //parts2.DrawOrder = 700;
            //Components.Add(parts2);


            _particleEffectSystem           = new cParticleEffectSystem(this);
            _particleEffectSystem.DrawOrder = 800;
            Components.Add(_particleEffectSystem);

            _lineManager           = new LineManager(this);
            _lineManager.DrawOrder = 500;
            Components.Add(_lineManager);

            _console.AddCommand("bloom", "toggles bloom", delegate { _bloom.Enabled = !_bloom.Enabled; _bloom.Visible = !_bloom.Visible; });
            _bloom           = new BloomComponent(this);
            _bloom.DrawOrder = 2000;
            Components.Add(_bloom);


            _audio = new cAudio();
        }