Memory game player vs computer problem

0 favourites
  • 2 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • I am puzzling about the computer part.

    How to make the computer pick the cards that has the right animation?

    When there is 2 cards that needs to be picked by computer

    and the condition to pick is: Animation2

    AND the computer must not pick if only one card is picked but two. (Since in memory game, both cards must be shown first and only afterwards destroyed)

    How to do this? I have tried many things: I have counted the sprites, I have spawn another sprite on top of it to "mark the card" etc.

    How to count those sprites that have animation2 and if there are 2 of them then destroy them. (If only one has animation2 it shouldn´t be destroyed at once)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Use instance variables. For example, add "isSelected" variable. When the first card is picked, set isSelected=true. When computer needs to select another card, search for a card that has the same animation name and isSelected=false.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)