Memory Matching game help

  • I'm trying to figure out how to make a mini game of matching objects but I don't know where to start. I read through several tutorials, but they all use animation frames from 1 sprite for matching objects, and I don't want to do that because I want to animate each sprite being matched and the sprite covering them separately.

    I don't want the whole game made for me, but I'd like some help randomly placing 2 of each ball sprite over the placeholder sprites. I tried for hours and I just get wonky effects. Can anyone show me a simple way fo doing this?

    https://www.dropbox.com/s/bjfhqjehkpbbkt4/ballMatch.c3p?dl=0

  • I would use an array to hold what is in each grid. Then, as they match, you can remove the sprite that is in that array entry.

    This looks like it will give you some pointers for a match-3 game.

    gamedevelopment.tutsplus.com/tutorials/make-a-match-3-game-in-construct-2-the-basics--gamedev-8071

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is my solution :

    If a placeholder is overlapped with any ball, it will stop spawning ball on it.

    I use pickedCount to count the ball quantity is overlap the placeholder greater than 2, it will destroy that color to save slot for the rest colors.

  • graham-s

    Thank you for your response. I should have been more clear. I'm trying to create a memory match mini game and not a Match 3 game. I'm not an advanced user, so I wouldn't know where to begin on how to adapt the tutorial you linked to my needs. I appreciate the suggestion though.

    Maverick1912

    Thank you for posting the screenshot. I'm a visual learner and it helps me a lot. Please bare with me, I'm an animator and I don't think like a programmer, but I'm trying to understand your logic. Let me know if I'm understanding you correctly.

    So for the first event, for each placeholder object, if a coloredBalls family member isn't overlapping it, create a coloredBalls family member on it. That sounds really good.

    In the second event, if the blueBall object is overlapping the placeholder object, set the global number blueBall to the number of instances of the blueBall object and if that number is greater than 2, pick a random blueBall instance and destroy it?

    Seems to make sense to me, but I think I did something wrong, because when I run the layout, I'm not getting 2 of each colored ball. Sometimes I get 5 of the same colored ball and sometimes one color of a ball is completely missing. Will you be kind enough to take a look and tell me where I went wrong? I'm not seeing it.

    https://www.dropbox.com/s/s1nieca86yzno7t/ballMatch02.c3p?dl=0

  • I found out where I went wrong. I made some changes and it works great now. Maverick1912, you are awesome! Thank you for the lesson!

    Here's a link to the working version:

    dropbox.com/s/29e3eu7ejjsu3w8/ballMatch03.c3p

  • You're welcome.

    Don't hesitate to raise your problem.

    Everyone will try their best to help you. :)

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