コード例 #1
0
        public void CasserMur(Joueur personnage, MyLabyrinthe laby)
        {
            if (personnage.isMur(personnage.Direction))
            {
                Point Position = personnage.Position;

                switch (personnage.Direction)
                {
                case Direction.HAUT:
                    Position = new Point(Position.X, Position.Y - 1);
                    break;

                case Direction.DROITE:
                    Position = new Point(Position.X + 1, Position.Y);
                    break;

                case Direction.BAS:
                    Position = new Point(Position.X, Position.Y + 1);
                    break;

                case Direction.GAUCHE:
                    Position = new Point(Position.X - 1, Position.Y);
                    break;
                }
                laby.ModifierLabyrinthe((int)Position.X, (int)Position.Y, false);
            }
        }
コード例 #2
0
ファイル: Joueur.cs プロジェクト: DamiSxM/Labyrinthe
 public void InitialisationCarte()
 {
     CarteLaby         = new MyLabyrinthe();
     CarteLaby.Tableau = new bool[Laby.Tableau.GetLength(0), Laby.Tableau.GetLength(1)];
     for (int i = 0; i < Laby.Tableau.GetLength(0); i++)
     {
         for (int j = 0; j < Laby.Tableau.GetLength(1); j++)
         {
             CarteLaby.ModifierLabyrinthe(i, j, false);
         }
     }
 }