예제 #1
0
        static void Test3()
        {
            Game game = Game.GameInstance;

            game.Labyrinthe.GenerationLabyrinthe("laby.txt");

            game.Labyrinthe.AfficherLabyrinthe();
            Console.ReadKey();
            Console.Clear();

            Combattant combattant1 = new Combattant("A", 100, 10, 0);

            (game.Labyrinthe.ListCase[21] as Libre).Occupant = combattant1;
            combattant1.CaseActuel = game.Labyrinthe.ListCase[21];

            game.Labyrinthe.AfficherLabyrinthe();
            Console.ReadKey();
            Console.Clear();

            //combattant1.ParcourirLabyrinthe();

            Thread thCombattant1 = new Thread(combattant1.ParcourirLabyrinthe);

            thCombattant1.Start();

            while (game.Labyrinthe.Sortie.Occupant == null)
            {
                Console.Clear();
                game.Labyrinthe.AfficherLabyrinthe();
                Thread.Sleep(100);
            }
            Console.Clear();
            game.Labyrinthe.AfficherLabyrinthe();
        }
예제 #2
0
        static void Test2()
        {
            Game game = Game.GameInstance;

            game.Labyrinthe.GenerationLabyrinthe("laby.txt");

            game.Labyrinthe.AfficherLabyrinthe();
            Console.ReadKey();

            Combattant combattant1 = new Combattant("A", 100, 10, 0);

            Combattant combattant2 = new Combattant("B", 100, 10, 1);

            Accessoire accessoire1 = new Pistolet();

            Accessoire accessoire2 = new Couteau();

            (game.Labyrinthe.ListCase[17] as Libre).Occupant = combattant1;
            (game.Labyrinthe.ListCase[49] as Libre).Occupant = combattant2;
            (game.Labyrinthe.ListCase[20] as Libre).Occupant = accessoire1;
            (game.Labyrinthe.ListCase[51] as Libre).Occupant = accessoire2;

            game.Labyrinthe.AfficherLabyrinthe();
        }
        public Combattant CreateCombattant(string nom, int vie, int capacite, int typeCaractere)
        {
            Combattant combattant = new Combattant(nom, vie, capacite, typeCaractere);

            return(combattant);
        }