Example #1
0
 //PONER FINAL
 static void Final(Tablero partida,int jugador)
 {
     Console.BackgroundColor = partida.jugadores[jugador].Colorjugador;
     Console.SetCursorPosition(25, 20);
     Console.ForegroundColor = ConsoleColor.Black;
     Console.Write("\t\t\t ENHORABUENA HAS GANADO\t\t\t");
     Musicas music = new Musicas();
     music.MusicaGanar();
 }
Example #2
0
        static void Main(string[] args)
        {
            Graficos grafic=new Graficos(ConsoleColor.DarkGreen);
            Tablero partida = new Tablero();
            Console.SetCursorPosition(0, 0);
            PartidaJugar(grafic, partida);

            Console.ReadKey();
        }
Example #3
0
        //MOSTRAR DONDE ESTA LA FICHA PARA MOVER
        static void PintarMovimiento(Tablero partida,int jugador,int x, Graficos g)
        {
            int fil;
            //LIMPIA LA ANTERIOR POSICION
            Console.BackgroundColor=g.FondoPantalla;
            for (fil = 0; fil < 3; fil++)
            {
                Console.SetCursorPosition(0, 0 * 4 + 2 + fil);
                Console.Write("\t\t\t\t\t\t\t\t\t   ");
            }

            //NOS LA PINTA EN PANTALLA
            Console.BackgroundColor =partida.jugadores[jugador].Colorjugador;
            for (fil = 0; fil < 3; fil++)
            {
                Console.SetCursorPosition((x * 9) + 3, 0 * 4 + 2 + fil);
                Console.Write("      ");
            }
        }
Example #4
0
 //BUCLE DE PARTIDA NORMAL
 static void PartidaJugar(Graficos grafic, Tablero partida)
 {
     bool terminar=false;
     int jugadormueve,pos;
     for (jugadormueve = 0; jugadormueve < 2&&terminar!=true; jugadormueve++)
     {
         do
         {
             pos = DondeMover(partida, grafic, jugadormueve);
             Console.Beep(partida.jugadores[jugadormueve].Pitido, 200);
         } while (partida.Mover(jugadormueve, pos) == false);
         if (jugadormueve == 1)
             jugadormueve = -1;
         terminar=partida.AlguienGana();
     }
     //PARA QUE NOS MUESTRE EL COLOR DEL JUGADOR GANADOR
     if (jugadormueve == 1)
         jugadormueve = 0;
     else
         jugadormueve = 1;
     Final(partida,jugadormueve);
 }
Example #5
0
 // ELEGIR DONDE SE MUEVE
 static int DondeMover(Tablero partida, Graficos g,int jugadormueve)
 {
     int pos=3;
     ConsoleKey tecla;
     do
     {
         PintarMovimiento(partida, jugadormueve, pos, g);
         tecla = Console.ReadKey(true).Key;
         if (tecla == ConsoleKey.RightArrow)
             pos++;
         if (tecla == ConsoleKey.LeftArrow)
             pos--;
         if (pos<0)
             pos=0;
         if (pos >7)
             pos = 7;
         if (tecla == ConsoleKey.S)
             partida.music.PararMusica();
         if (tecla == ConsoleKey.M&&partida.music.MusicaON==false)
             partida.music.Musicapresentacion();
     } while (tecla != ConsoleKey.Enter);
     return pos;
 }