コード例 #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.

            InputDevice2.Initalize();

            HighScoresState.InitalizeHighScores();

            //replace this with a join screen later
#if XBOX
            InputDevice2.LockController(InputDevice2.PPG_Player.Player_1, InputDevice2.PlayerPad.GamePad1);
#elif WINDOWS
            InputDevice2.LockController(InputDevice2.PPG_Player.Player_1, InputDevice2.PlayerPad.Keyboard);
#endif

            spriteBatch = new SpriteBatch(GraphicsDevice);

            AnimationLib al = new AnimationLib(GraphicsDevice, spriteBatch);
            AnimationLib.cacheAtlasFiles();

            //some of these assets are critical to render anything to the screen, and thus are not stored in a seperate thread
            saveIcon             = Content.Load <Texture2D>("gfx/saveIcon");
            debugFont            = Content.Load <SpriteFont>("testFont");
            whitePixel           = Content.Load <Texture2D>("whitePixel");
            pleaseWaitDialog     = Content.Load <Texture2D>("pleaseWait");
            asteroidsSpriteSheet = Content.Load <Texture2D>("ppg_asteroids");

            for (int i = 0; i < starCount; i++)
            {
                stars[i]        = new Vector2(rand.Next() % 2000 - 1000, rand.Next() % 2000 - 1000);
                starRotation[i] = (float)(rand.NextDouble() % (Math.PI * 2));
            }

            new Thread(loadSpine2).Start();
            new Thread(loadContent2).Start();
        }