Well, I´m programming a memorama game, when a pair of cards are clicked, the comparison is automatically, and it can´t appreciate both images of cards because they are flipped (when are not equal) or dissapear (if both are equal).
So I read the documentation and found Greenfoot.delay(). I tested it and worked the first time (yesterday) both cards stay freeze two seconds before being flipped, but I opened my project today and Greenfoot.delay() don´t worked, and i wondering why stops working?. Or, exists any other way to pause the game or freeze the cards before being flipped?
this is how I´m using the method
1 2 3 4 5 6 7 8 9 10 11 12 | //For example when both cards are equal else if (duanvaloron==valoron && ( (unu== "a" && duan== "b" ) || (unu== "b" && duan== "a" ) ) ){ Greenfoot.delay( 150 ); malenigi(); //cards dissapear //resetting my counters duanvaloron= 0 ; valoron= 0 ; kontisto= 0 ; unu= "" ; duan= "" ; posto++; } |