0

I writing the card flipping game. But i need to help. i have 36 piece card (front & rear faces). 36 of them can be opened, but I only want to open 2 and close if not compatible.

.java

card2.setOnFlipListener( new EasyFlipView.OnFlipAnimationListener() {
        @Override
        public void onViewFlipCompleted(EasyFlipView easyFlipView, EasyFlipView.FlipState newCurrentSide) {
            counter2 += 1;
            if (counter2 % 2 == 0) {
            }
            else{
                if (counter30 % 2 != 0) {
                    card2.setVisibility( View.INVISIBLE );
                    card30.setVisibility( View.INVISIBLE );
                    puan();
                }
            }
        }
    } );

.xml
<com.wajahatkarim3.easyflipview.EasyFlipView
    android:id="@+id/card8"
    android:layout_width="55dp"
    android:layout_height="75dp"
    android:layout_toRightOf="@+id/card1"
    android:layout_marginLeft="10dp"
    android:layout_above="@+id/card1"
    android:layout_marginBottom="5dp"
    app:flipOnTouch="true"
    app:flipDuration="500"
    app:flipEnabled="true"
    app:flipType="horizontal">

    <ImageView
        android:layout_gravity="center"
        android:src="@drawable/onmaca"
        android:layout_width="55dp"
        android:layout_height="75dp"/>

    <ImageView
        android:layout_gravity="center"
        android:src="@drawable/cardback"
        android:layout_width="55dp"
        android:layout_height="75dp"/>
</com.wajahatkarim3.easyflipview.EasyFlipView>
MohanKumar
  • 960
  • 10
  • 26
  • Question is not clear. As i understood you have issue with your business logic not with android specific. What kind of technical help you want. please update. Thanks. – CodeWithVikas Nov 02 '19 at 18:37
  • Hi, firstly sorry for my bad English, im learning now, I'm beginner in android studio(java). I don't know how to tell my problem. I have 36 piece solitaire cards, and i write the card matching game. .xml is my design page thats the cards properties, .java is my codes thats, this code is working like that : if two cards are turned, they are invisible. My problem is; if 2 cards do not match, they will return again and no more cards can be opened. I hope I could write clearly. Sometimes i use Translate :) – Enes YAĞCI Nov 08 '19 at 11:56

0 Answers0