Пример #1
0
        private void MoveCharacterNorth(Label CurrentTile)
        {
            Tile  currentTile    = _tileLogic.GetTileByLabelName(CurrentTile.Name);
            Label northTileLabel = _tileLogic.GetLabelByTileName(currentTile.NorthTileName);

            if (currentTile.North == true)
            {
                PlayerCharacter.CurrentTileLocation = currentTile.NorthTileName;
                CurrentTile.Text    = "";
                northTileLabel.Text = "X";
            }
        }
Пример #2
0
        public GameWindow(Character playerCharacter)
        {
            InitializeComponent();
            _tileLogic = (TileLogic)Program.ServiceProvider.GetService(typeof(TileLogic));
            TilesDb.CreateTiles();
            //you can't actually dictate unicode in the designer properties box so have to do it via code which is what this is.
            leftButton.Text  = "\u2190";
            rightButton.Text = "\u2192";
            upButton.Text    = "\u2191";
            downButton.Text  = "\u2193";

            foreach (Control c in this.Controls)
            {
                if (c.Name.Contains("tile"))
                {
                    tileNames.Add((Label)c);
                }
            }
            _tileLogic.GetLabelByTileName(playerCharacter.CurrentTileLocation).Text = "X";
        }