Memory Matching Game Blueprint for hyperPad on iPad
Logo

Memory Matching Game Blueprint for hyperPad on iPad

October 7, 2026
hyperPad How-TosBeginnershyperPad Starter

A memory matching game is a useful first project because the rules are familiar: reveal two cards, keep a matching pair visible, and hide a mismatched pair. Building that loop introduces touch input, stored values, conditions, game state, and a win check.

This documentation-based blueprint plans a six-card matching game with current hyperPad Behaviors. It has not been completed as a live-tested Starter project. Use it to understand the structure, then verify each chain in your current app before relying on it for a class or published game. The first version uses letters instead of custom art so you can focus on how the game works.

What you will build

The board contains three pairs: A, B, and C. Every card starts by showing a question mark.

When you touch a card:

  1. the card reveals its letter
  2. the game remembers the first selection
  3. the second selection is compared with the first
  4. matching cards stay visible
  5. different cards return to question marks after a short delay
  6. finding all three pairs ends the game

Keep this first version in one Scene.

1. Create the Project and board

Create a new hyperPad Project and choose Bird's Eye View. According to the Creating a New Project guide, Bird's Eye View disables gravity by default and is suitable for UI-based and puzzle projects.

Add six Label Objects to the Scene UI layer. Arrange them in two rows and name them Card1 through Card6. Set each label's visible text to ?.

Add two more labels:

  • StatusLabel displays instructions and results.
  • ReplayButton displays Play again.

Add one Object outside the visible play area and name it GameController. This Object will store values shared by the whole game.

2. Store each card's identity and state

Attributes store values on an Object. Add these predefined Attributes to every card:

  • pairID: the card's hidden letter
  • state: whether the card is hidden, currently revealed, or already matched

Assign the letters in pairs:

CardpairID
Card1A
Card2B
Card3C
Card4B
Card5C
Card6A

Use these state values:

StateMeaning
0hidden and available
1revealed during the current turn
2matched and no longer available

The Object Attributes guide explains how to define stored values. Get Attribute retrieves a value from a selected Object, while Set Attribute changes it.

3. Add the shared game state

Add these predefined Attributes to GameController:

AttributeInitial valuePurpose
`firstPair`emptystores the first selected letter
`selectedCount`0records whether one card is waiting
`locked`0blocks another selection while a turn resolves
`pairsFound`0counts completed pairs

Use locked = 0 when input is available and locked = 1 while the second selection is being checked.

Keeping shared state on one controller Object makes it easier to inspect the game's logic. Card-specific values remain on each card.

4. Make a card reveal its letter

Open Card1's Behavior Editor. Start the chain with Started Touching. The documentation states that this Behavior triggers once when the selected Object is touched.

Use Get Attribute and If to check two conditions:

  • GameController's locked value equals 0
  • Card1's state value equals 0

The If Behavior runs its connected actions when a condition is met. If both checks pass:

  1. set GameController's locked Attribute to 1
  2. set Card1's state to 1
  3. get Card1's pairID
  4. use Set Label to display that value on Card1
  5. broadcast a message named CardSelected, passing the pairID as its value

Execution connections control when Behaviors run. Value connections pass data into Behavior properties. The Sharing Values Between Behaviors guide explains this distinction.

5. Remember the first selection

On GameController, add Receive Message and set its Event Key to CardSelected. Receive Message listens for the matching broadcast and provides its Broadcast Value as an output.

Read selectedCount.

If selectedCount = 0, this is the first card:

  1. store the received letter in firstPair
  2. set selectedCount to 1
  3. change StatusLabel to Choose another card.
  4. set locked back to 0

The first card remains visible while the player chooses a second card.

6. Compare the second selection

Create an Else If branch for selectedCount = 1. The If documentation explains that you create an Else If by snapping another If to the right of the first.

In this branch:

  1. get GameController's firstPair
  2. compare it with the Broadcast Value received from the second card
  3. send the result into separate match and mismatch branches

Input remains locked until one of those branches finishes.

7. Keep a matching pair

When the two letters are equal:

  1. broadcast KeepPair
  2. add 1 to pairsFound
  3. save the new total
  4. clear firstPair
  5. set selectedCount to 0

Each card listens for KeepPair. A card changes its state from 1 to 2 only when it is currently revealed. Hidden cards and previously matched cards do not change.

After updating the count, check pairsFound:

  • If it equals 3, change StatusLabel to You found all three pairs! and leave input locked.
  • If it is below 3, change StatusLabel to A match! Choose another card. and set locked to 0.

8. Hide a mismatched pair

When the letters are different, change StatusLabel to Not a match. Remember those letters.

Add Wait and choose a short delay such as 0.8 seconds. Wait triggers its next connected event only after the specified time.

After Wait finishes:

  1. broadcast HidePair
  2. clear firstPair
  3. set selectedCount to 0
  4. change StatusLabel to Choose a card.
  5. set locked to 0

Each card listens for HidePair. If its state equals 1, Set Label changes its text back to ? and Set Attribute returns its state to 0.

9. Apply the card logic to all six cards

Add the same touch, KeepPair, and HidePair logic to Card2 through Card6.

After copying Behaviors, inspect every Object selection. The touch event, pairID, state, and Set Label action must point to the card you are editing. The shared locked, selectedCount, firstPair, and pairsFound Attributes must still point to GameController.

This check prevents a copied card from revealing or changing Card1 by mistake.

10. Add a restart button

On ReplayButton, connect Started Touching to Restart Scene.

Restart Scene restarts the current Scene. Its Refresh option resets UI Objects and mirrored Objects to their starting state. Keep Refresh enabled so the labels and initial board state are restored.

Required validation before you call the project complete

Build the project in the current version of hyperPad, then press Play and verify:

  • the first card reveals one letter
  • touching the same revealed card does not count twice
  • a matching pair stays visible
  • a mismatched pair hides after the delay
  • input remains locked while a mismatch is visible
  • only a matching branch increases pairsFound
  • the win message appears after three pairs
  • Play again restores the starting board

If a value appears in the wrong card, inspect the Object selected in Get Attribute, Set Attribute, and Set Label. If a comparison never passes, confirm that the value output is connected to the If input rather than only connecting the execution line.

Make the game your own

Once the letter version works, replace the letters with vocabulary pairs, math questions and answers, or original illustrations. Keep each pair's shared pairID and the same state logic.

You can also add a timer or move counter after the matching loop is reliable. Add one feature at a time and test the full board again after each change.

Try hyperPad Starter and build your first six-card matching game on iPad.

hyperPad Starter

Make Your First Game on iPad

Start with one free project in hyperPad Starter. Drag, drop, and connect Behaviors to build your game without traditional code.

Try hyperPad Starter

Free to download · One project included