Пример #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 and
        /// non-graphic related content.  Calling base.Initialize will enumerate
        /// through any components and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // This places the HUD near the upper left corner of the screen
            hudLocation = new Vector2(
                (float)Math.Floor(screenWidth * .1f),
                (float)Math.Floor(screenHeight * .1f));

            // places the cursor in the center of the screen
            cursorLocation =
                new Vector2((float)screenWidth / 2, (float)screenHeight / 2);

            // places the tank halfway between the center of the screen and the
            // upper left corner
            tank.Reset(
                new Vector2((float)screenWidth / 4, (float)screenHeight / 4));

            base.Initialize();
        }
Пример #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()
        {
            // This places the HUD near the upper left corner of the screen
            hudLocation = new Vector2(
                (float)Math.Floor(screenWidth * .1f),
                (float)Math.Floor(screenHeight * .1f));

            // places the cursor in the center of the screen
            cursorLocation =
                new Vector2((float)screenWidth / 2, (float)screenHeight / 2);

            // places the tank halfway between the center of the screen and the
            // upper left corner
            tank.Reset(
                new Vector2((float)screenWidth / 4, (float)screenHeight / 4));

            base.Initialize();

#if WINDOWS_PHONE
            renderTarget = new RenderTarget2D(graphics.GraphicsDevice, 800, 480);
#endif
        }