示例#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);

            whitepixel  = new Texture2D(GraphicsDevice, 1, 1);
            whitepixel.SetData(new Color[] { Color.White });

            astarwaypoint = Content.Load<Texture2D>("AStarWayPoint");
            edited = true;

            font = Content.Load<SpriteFont>("gameFont");

            tools = new Tool[2][];
            tools[0] = new Tool[4];
            tools[1] = new Tool[4];

            tools[0][0] = new Tool(TileType.GRASS, Content.Load<Texture2D>("Grass"), false, 1);
            tools[0][1] = new Tool(TileType.TREES, Content.Load<Texture2D>("Trees"), false, 2);
            tools[0][2] = new Tool(TileType.SWAMP, Content.Load<Texture2D>("Swamp"), false, 4);
            tools[0][3] = new Tool(TileType.PLAYER, Content.Load<Texture2D>("Player"), false, 0);
            tools[1][0] = new Tool(TileType.WATER, Content.Load<Texture2D>("Water"), false, 6);
            tools[1][1] = new Tool(TileType.ROCKS, Content.Load<Texture2D>("LavaRocks"), false, 8);
            tools[1][2] = new Tool(TileType.WALL, Content.Load<Texture2D>("Wall"), true, 0);
            tools[1][3] = new Tool(TileType.MONSTER, Content.Load<Texture2D>("Monster"), false, 0);

            map = new TileMap(10, 10, 16, whitepixel, tools[0][0]);
            toolmap = new ToolMap(578, 100, whitepixel, tools, font);
            // TODO: use this.Content to load your game content here
        }