Esempio n. 1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            stars = new SkyBox(this);
            Components.Add(stars);

            camera = new Camera(this, new Vector3(0, 0, 50), Vector3.Zero, Vector3.Up);
            //Components.Add(camera); // actually -- why the heck is the camera its own game component? Whatever... it doesn't need to be for my purposes.

            // we want the bullets to move before the models run their Update() calls
            // that's to avoid having the bullets taking one move before collision detection is ever run, which spoils point-blank shots :V
            bulletManager = new ModelManager(this);
            Components.Add(bulletManager);

            modelManager = new ModelManager(this);
            Components.Add(modelManager);

            gameMenu = new MainMenu(this);
            Components.Add(gameMenu);

            screen.Push(gameScreen.gameMenu); // start at the main menu?

            debugcons = new IOConsole(this);
            Components.Add(debugcons);
            IOConsole.instance = debugcons;


            dispatcher = new Dispatcher(this);
            Components.Add(dispatcher); // for the sake of completeness... not sure if it'll use any of the actual game component interface, actually

            hud = new HUD(this, font);
            Components.Add(hud);


            base.Initialize();
        }
Esempio n. 2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            stars = new SkyBox(this);
            Components.Add(stars);

            camera = new Camera(this, new Vector3(0, 0, 50), Vector3.Zero, Vector3.Up);
            //Components.Add(camera); // actually -- why the heck is the camera its own game component? Whatever... it doesn't need to be for my purposes.

            // we want the bullets to move before the models run their Update() calls
            // that's to avoid having the bullets taking one move before collision detection is ever run, which spoils point-blank shots :V
            bulletManager = new ModelManager(this);
            Components.Add(bulletManager);

            modelManager = new ModelManager(this);
            Components.Add(modelManager);

            gameMenu = new MainMenu(this);
            Components.Add(gameMenu);

            screen.Push(gameScreen.gameMenu); // start at the main menu?

            debugcons = new IOConsole(this);
            Components.Add(debugcons);
            IOConsole.instance = debugcons;

            dispatcher = new Dispatcher(this);
            Components.Add(dispatcher); // for the sake of completeness... not sure if it'll use any of the actual game component interface, actually

            hud = new HUD(this, font);
            Components.Add(hud);

            base.Initialize();
        }