Skip to first unread message

Projeto AppInventor

unread,
Sep 23, 2015, 3:45:43 AM9/23/15
to MIT App Inventor Forum

Hello all,

I am trying to implement a memory game with 6 buttons, each of them will show an image after pressed. I have to match 2 equal images in two buttons. If there is no matching, all the buttons will not show any image and so on. If two images are matched they continue showing to the user until the user matches all the images.

I saw something in this tutorial https://www.youtube.com/watch?v=C3SeIN7hfUc but it is quite confusing and I don't believe it works. Actually it is the only tutorial I found in the net.

Do you know any other tutorial for matching games with app inventor or can help me with questions I have related to the video tutorial? for example, what are supposed to be the buttons a1, a2 and a3?

Best Regards,

Toni Schuh

unread,
Sep 23, 2015, 6:51:17 AM9/23/15
to MIT App Inventor Forum
I think you should look at the advanced quiz at the puravida apps homepage. It puts the buttons into a list and then tests if the correct button was clicked. You would have to adept this to your images, but once you understand how the advanced quiz works this should be easy.

SteveJG

unread,
Sep 23, 2015, 8:12:36 AM9/23/15
to mitappinv...@googlegroups.com
This is a different type of matching game    

Dog Gone! … a tile matching game tutorial for App Inventor 2

                                       .  It matches tiles.  The same techniques could be applied to your game.   


The type of game you describe is similar to a game called Simon.  Here is a thread   https://groups.google.com/forum/#!topic/mitappinventortest/gdh4APZLnZQ    T

Here is an app inventor classic tutorial ...AI2 is similar  http://turing.cs.trincoll.edu/~ram/cpsc110/tutorials/memorygame/        This uses colors, you could use images.
The download is an ai classic zip file, it needs to be converted using the AI to AI2 converter  http://convert.appinventor.mit.edu/   ... edit: the MIT converter tool will NOT convert this project..sorry.

Regards,
Steve

Ghica

unread,
Sep 23, 2015, 10:04:29 AM9/23/15
to MIT App Inventor Forum
Before going into tutorials, make sure that you know what to do. Start with making a design. 6 buttons is probably not enough because that would imply only three different images. Make it 12. Put them in a table layout, in a 3x4 arrangement.
The next step would be to display the images (do not bother about hiding them yet) randomly on your screen, having two of each.
It involves creating a list of the buttons (during Screen1.Initialize) and a list of image names. Be sure to know how to use the any blocks.
You would have a list of 6 image names. To put them randomly in the buttons, you would create a new list witch each name twice. Then you would go through the list of buttons and assign a random item from the new list you just made, removing it from the list after you have assigned the picture. Make yet another list which keeps track of which button has which image.
If you get this far, report back, or maybe you found out how to do the checking by then.
Cheers, Ghica.

Projeto AppInventor

unread,
Sep 24, 2015, 2:50:53 AM9/24/15
to MIT App Inventor Forum
I solved the problem by adapting the source of Dog Gone app for appinventor, as suggested by SteveJG.

Thank you so much people.

SteveJG

unread,
Sep 24, 2015, 9:45:50 AM9/24/15
to MIT App Inventor Forum
Here is an aia Simon Memory game posted to the Classic Gallary   (yes, the Classic Gallery is still available although the Classic compiler is not)   http://classic-gallery.appinventor.mit.edu/#page%3DApp%26uid%3D31356001%26label%3DSimon        There are also several other versions in this Gallery that are in zip format (not converted to an aia) that might work in App Inventor 2 if converted using the tool here  http://convert.appinventor.mit.edu/    

Regards,
Steve


Reply all
Reply to author
Forward
0 new messages