Microsoft DirectX 8.1 (Visual Basic) |
Memory is a simple game in which you match tiles and try to score the most points.
Source: (SDK root)\Samples\Multimedia\VBSamples\DirectPlay\Memory
Executable: (SDK root)\Samples\Multimedia\VBSamples\DirectPlay\Bin
Double-click the Memory icon to start the game. The application opens a small window and you can choose Multiplayer or Solitaire. When the Memory board opens, begin selecting tiles and try to match the images. Score one point for every match. In multiplayer mode, try to get more matches than your opponent(s). In solitaire mode, try to clear the board in as few attempts as possible.
The Memory sample is very similar in form to the SimplePeer sample. For more information, see the Programming Notes section of the SimplePeer sample.
When a tile is clicked, the application will take the following steps.
When the Memory sample receives the DPNMSG_RECEIVE message, the DirectPlay8Event_Recieve function:
The application will the process the following message types.
MSG_SETUPBOARD | Retrieve board information and update the local state. |
MSG_SHOWPIECE | Show the image behind the indicated tile. |
MSG_HIDEPIECES | Hide all tiles that aren't currently matched. |
MSG_TURNEND | Advance to the next players turn. |
MSG_CHAT | Receive a text string and update the user interface (UI). |
MSG_MATCHED | Set the state so these two pictures are marked as matched. |