private void UpdateWorld()
        {
            TileBoard.Clear(new UITileBoardTile((int)TileID.Grass, RGBColor.DarkOliveGreen));

            int x, y;

            for (y = 0; y < TileBoard.Size.Height; y++)
            {
                for (x = 0; x < TileBoard.Size.Width; x++)
                {
                    switch (MAP[y][x])
                    {
                    case 'D': TileBoard[x, y] = new UITileBoardTile((int)(DoorOpen ? TileID.DoorOpen : TileID.DoorClosed), RGBColor.SaddleBrown); break; // Door

                    case 'f': TileBoard[x, y] = new UITileBoardTile((int)TileID.Wall, new RGBColor(64), 0, TileVFX.Negative); break;                     // Floorboards

                    case 'T': TileBoard[x, y] = new UITileBoardTile((int)TileID.Tree, RGBColor.ForestGreen, 0, TileVFX.OscillateTopSlow); break;         // Tree

                    case 'w': TileBoard[x, y] = new UITileBoardTile((int)TileID.Grass, RGBColor.Blue, 0, TileVFX.WaveHorizontalMedium); break;           // Water

                    case 'W': TileBoard[x, y] = new UITileBoardTile((int)TileID.Wall, RGBColor.Gray); break;                                             // Wall

                    default: TileBoard[x, y] = new UITileBoardTile((int)TileID.Grass, RGBColor.DarkOliveGreen); break;                                   // Grass
                    }
                }
            }

            TileBoard[PlayerPosition] = new UITileBoardTile((int)TileID.Skeleton, RGBColor.AntiqueWhite);
        }
Beispiel #2
0
        protected override void OnInitialize(object[] parameters)
        {
            UI.Cursor.Enabled     = true;
            UI.Cursor.Position    = BOARD_POSITION;
            UI.Cursor.BoundingBox = new Area(BOARD_POSITION, BOARD_SIZE);
            UI.Cursor.Moveable    = true;
            UI.Cursor.Tile        = (int)TileID.Cursor;
            UI.Cursor.VFX         = TileVFX.None;

            AddLabel(1, 1, "DRAWING BOARD", (int)TileID.Font, RGBColor.PaleGoldenrod);

            AddFrame(
                BOARD_POSITION - Position.One, BOARD_SIZE + Dimension.One * 2,
                (int)TileID.Frame, RGBColor.White);

            TileBoard = AddTileBoard(BOARD_POSITION.X, BOARD_POSITION.Y, BOARD_SIZE.Width, BOARD_SIZE.Height);
            TileBoard.Clear(new UITileBoardTile(1, RGBColor.Blue));

            AddLabel(2, UI.Game.Renderer.TileCount.Height - 5, "Arrow keys, gamepad sticks/DPad: move cursor", (int)TileID.Font, RGBColor.PaleGoldenrod);
            AddLabel(2, UI.Game.Renderer.TileCount.Height - 4, "Space, gamepad buttons: paint tile", (int)TileID.Font, RGBColor.PaleGoldenrod);
            AddLabel(2, UI.Game.Renderer.TileCount.Height - 3, "F: fullscreen toggle, ESC: back", (int)TileID.Font, RGBColor.PaleGoldenrod);
        }