Exemple #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()
        {
            playerPosition = new Vector3(0f, 3f, 5f);
            targetPosition = new Vector3(0f, 3f, 0f);

            // TODO: Add your initialization logic here
            IsMouseVisible = true;
            camera = new Camera(this, playerPosition, targetPosition, Vector3.Up);
              //     cube = new Sphere(this, camera);
            Components.Add(camera);
               // Components.Add(cube);

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

            base.Initialize();
        }
Exemple #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
            camera = new Camera(this, new Vector3(0, 700, 700), new Vector3(0,25,0), Vector3.Up);
            Components.Add(camera);

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

            //开始界面
            modelManager.Enabled = false;
            modelManager.Visible = false;
            // Splash screen component
            splashScreen = new SplashScreen(this);
            Components.Add(splashScreen);
            splashScreen.SetData("Tank surrounded by Ghosts", currentGameState);
            //开始界面end-------------

            IsMouseVisible = true;
            base.Initialize();
        }