コード例 #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);

            MazeOptions options = new MazeOptions(
                new Vector2(1, 3),
                23,
                16,
                Content.Load <Texture2D>("Textures/Objects/SoftProDollar"));

            _maze = new Maze(graphics.GraphicsDevice, options);

            MazeRunnerOptions runnerOptions = new MazeRunnerOptions(
                _maze,
                Content.Load <Texture2D>("Textures/Players/John/CloseupSmall"),
                Content.Load <SoundEffect>("Audio/Effects/SoftProDollarCollected"),
                100);


            _runner = new MazeRunner(this, runnerOptions);

            _boss = new MazeBoss(
                Content.Load <Texture2D>("Textures/Objects/Boss"),
                new Vector2(0, 0),
                new Vector2(800, 0),
                new TimeSpan(0, 1, 0),
                Content.Load <Texture2D>("Textures/Objects/ConferenceRoom"));
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Maze"/> class.
        /// </summary>
        /// <param name="device">The device.</param>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        public Maze(GraphicsDevice device, MazeOptions options)
        {
            _texture = new Texture2D(device, 1, 1);
            _texture.SetData <Color>(new Color[] { options.WallColor });
            _device        = device;
            _dollarTexture = options.DollarTexture;

            _height         = options.Height;
            _width          = options.Width;
            _cellSize       = options.CellSize;
            _cellWallWidth  = options.CellWallWidth;
            _startingVector = options.StartingVector;

            GenerateMaze();
        }