Resources, dialog boxes, controls
"Memory" game on owner-draw menu
- Demonstration
- Create a "Memory" game, which uses owner-draw menus for displaying the items:
- Game rules:
- the game takes place on the board of 4x4 cards
- the are 8 symbols, each of them appears on two randomly chosen cards
- at the start all the cards are flipped over, so the symbols on the cards are not
visible
- the user reveals two chosen cards; if the symbol on both is the same, both cards become permanently revealed; if not, the are revealed only until the user reveals another card
- the game is over when all the cards are revealed
- Technical requirements:
- each card should be a separate menu option; there are 4 submenus of a main menu, each containing 4 cards
- use the images from here as the symbols; the images should be stored in program resources
- the cards which are just revealed by the user should be marked red; if they become revealed permanently, they should be marked green
- the menu should have an option for restarting the game (if the game is started /
restarted, the symbols on the cards should be placed randomly)
- after the game is over, the message box should appear saying the game has ended up
- Hints:
- GetMenu(), GetMenuItemInfo(), SetMenuItemInfo(), MFT_OWNERDRAW
- WM_MEASUREITEM, WM_DRAWITEM
- LoadBitmap(), BitBlt()
- Approximate points:
- using owner-draw menu 4.0
- displaying bitmaps 3.0
- game logic 3.0