Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        protected override void OnInputEvent(KeyCode key, ModifierKeys modifiers, int gamepadIndex, bool isRepeat)
        {
            switch (key)
            {
            case KeyCode.Space:
            case KeyCode.GamepadX:
            case KeyCode.GamepadA:
            case KeyCode.GamepadY:
                Position boardPosition = UI.Cursor.Position - BOARD_POSITION;
                TileBoard[boardPosition] = new UITileBoardTile(2, RGBColor.BurlyWood);
                return;

            case KeyCode.Escape:
            case KeyCode.GamepadB:
                UI.ShowPage <PageMainMenu>();
                return;
            }
        }