Example #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.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            device = graphics.GraphicsDevice;

            officeTexture = Content.Load<Texture2D>("OfficeTemplate");
            playerTexture = Content.Load<Texture2D>("You");
            NPCTexture = Content.Load<Texture2D>("NPC");
            font = Content.Load<SpriteFont>("Georgia");
            menuTexture = CreateRectangle(400, 400);

            screenWidth = device.PresentationParameters.BackBufferWidth;
            screenHeight = device.PresentationParameters.BackBufferHeight;

            gameOverTexture = CreateRectangle(screenWidth, screenHeight);
            alertTexture = CreateRectangle(screenWidth / 2, screenHeight / 2);

            playerObject = new Player(playerTexture, officeTexture);
            level = new Map(officeTexture, screenWidth, screenHeight, playerObject.getLocation());
            menu = new GameMenu();

            gameEvents = new RandomGameEvents(playerObject);
        }