[Mono-dev] (no subject)

David Caro esquizofrenia at gmail.com
Fri Nov 10 15:20:08 EST 2006


Well, i upload source of my program here:
http://changuitos.free.fr/memorama
You can run it - Archivo -> Nuevo Juego
it is nos finished, well please help me with the second card, it never flip
up...

Maproz

Caro <esquizofrenia at gmail.com>:
>
> Hi, I'm programming a Memory game for my C# topic at university, i'm
> finished that but there is a problem with a queuedraw (i think that) cause
> the second card doesnot turn up at time...
> "the second card doesnt flip (roll) at button click time" and i dont know
>
> Thanks if you can help me
>
>    1. /* it is from the manager class */
>    2.
>    3.      public void EstadoCarta1(EventBox entrante){
>    4.                 carta1=entrante;
>    5.                 imagen1=(Carta)carta1.Child;
>    6.                 imagen1.VolteaFrontal( );
>    7.                 Thread.Sleep(10);
>    8.                 carta1.ButtonPressEvent -= new
>    9. Gtk.ButtonPressEventHandler (Carta.SelCarta);
>    10.                 estado= Columnas.Carta2;
>    11.         }
>    12.
>    13.         public void EstadoCarta2 (EventBox entrante){
>    14.                         carta2=entrante;
>    15.                         imagen2= (Carta)entrante.Child;
>    16. // AQUI NO HACE NADA
>    17.                         imagen2.VolteaFrontal ();
>    18.                         Thread.Sleep(10);
>    19.                         System.Console.WriteLine("Segunda Carta"
>    );
>    20.                           carta2.ButtonPressEvent -= new
>    21. Gtk.ButtonPressEventHandler(Carta.SelCarta);
>    22.                         imagen2.Sensitive=true;
>    23.
>    24.                         if(imagen1.Frontal.Equals(
>    imagen2.Frontal )){
>    25.                                 jugando++;
>    26.                                 imagen1.Sensitive=false;
>    27.                                 imagen2.Sensitive=false;
>    28.                                 imagen2.VolteaFrontal();
>    29.                         }
>    30.                         else{
>    31.                                 Thread.Sleep(1000) ;
>    32.                                 imagen1.VolteaLogo();
>    33.
>    34.                                 imagen2.VolteaLogo();
>    35.                                 MeterJugador() ;
>    36.                                 SacarJugador();
>    37.
>    this.JugadorTurno.Text=this.jugando.Nombre;
>    38.                                 carta1.ButtonPressEvent += new
>    39. Gtk.ButtonPressEventHandler (Carta.SelCarta);
>    40.                                 carta2.ButtonPressEvent += new
>    41. Gtk.ButtonPressEventHandler(Carta.SelCarta);
>    42.                         }
>    43.                                 //      En ambos casos cambia el
>    estado
>    44.                         estado=Columnas.Carta1;
>    45.         }
>    46.
>    47.         public void JugadorEstado(EventBox entrante){
>    48.                 if (estado==Columnas.Carta1){
>    49.                         this.EstadoCarta1(entrante );
>    50.                 }
>    51.                 else if(estado==Columnas.Carta2 ){
>    52.                         this.EstadoCarta2(entrante);
>    53.                 }
>    54.                 // Acabe
>    55.         }
>    56.
>    57. /* It is from card class */
>    58.
>    59. public static event DelegadoJugador EventoJugador;
>    60.         bool valor;
>    61.
>    62.         static string logo="background.jpg";
>    63.         string frontal;
>    64.         public string Frontal{
>    65.                 get{
>    66.                         return frontal;
>    67.                 }
>    68.                 set {
>    69.                         frontal=value;
>    70.                 }
>    71.         }
>    72.
>    73.         // EVENTO CARTA
>    74.         public static void SelCarta (object o, EventArgs args){
>    75.                 // obtenemos la carta que presionó el usuario
>    76.                 Gtk.EventBox carta=(Gtk.EventBox)o;
>    77.                 System.Console.WriteLine ("Presionada");
>    78.                 EventoJugador(carta);
>    79.         }
>    80.
>    81.         /* Funciones de la imagen */
>    82.         public void VolteaLogo (){
>    83.                 this.FromFile="images/"+logo;
>    84.                 this.QueueDraw();
>    85.         }
>    86.
>    87.         public void VolteaFrontal(){
>    88.                 this.FromFile="images/"+frontal;
>    89.                 this.QueueDraw();
>    90.
>    91.         }
>    92.
>    93. /* Then i can conect with a delegate */
>    94. Carta.EventoJugador+=new DelegadoJugador(manager.JugadorEstado);
>    95.
>    96. /*
>    97. therefore, when a card is pressed, its is sended to the manager
>    and there the program checks which player has pressed that card...
>    98.
>    99. the only problem is the card 2 dont turn up ... */
>    100.
>    101. */
>
>
>
> http://pastebin.com/820673
>
> --
> To be or not to be
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>


-- 
To be or not to be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061110/edae87cb/attachment.html 


More information about the Mono-devel-list mailing list