I was looking into the memory game (again) and did the following pseudo-code-thingy. Quite simple really, but i did run into some problems. Memory kinda relies on some scripting or timing of some kind. Let me explain.
When the player clicks on a card he has to wait while the card turns around (usually animated). Then finally when it has finished turning around, he can select the next card. When the next card has finished turning around, both cards should stay visible for a while then both either disappear (if equal) or both turn over again. So how can one do this? Any ideas?
Anyone is welcome to join in with ideas please :) Here are some graphics for a memory game.
Here's my code. Notice i just wrote //wait but that won't really work as the screen doesn't get updated until at the bottom of the main loop.
// Memory game // Initialize system // initialize graphics and mouse // Load images // Initialize game // Create and randomize cards // Main loop // If card clicked // Turn card // if two cards turned then // wait // if cards equal then // remove cards // else // hide cards again // if no cards left // end game // Draw cards // End loop