Interactive · Gutenberg
Memory Game block for WordPress
Interactive card-flip memory matching game with emoji themes, difficulty levels, move counter, timer, and best score tracking.
Get Blockenberg
Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.
What it actually does
Interactive card-flip memory matching game with emoji themes, difficulty levels, move counter, timer, and best score tracking.
Inspector panels on this block: Content, Game Settings. Those titles come from index.js, not from a shared template.
Behavior controls: “Default Difficulty” options: Easy (6 pairs, 4×3), Medium (8 pairs, 4×4), Hard (12 pairs, 6×4); “Card Theme” options: Animals 🐶, Food 🍕, Nature 🌸, Space 🚀, Sports ⚽.
Where to find it
Gutenberg inserter → Interactive → search “Memory Game” (block name `blockenberg/memory-game` in block.json). Style it in the sidebar after insert.
How to use Memory Game block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Memory Game”, insert it. Category: Interactive.
- Configure inspector controls that exist on this block. Open Content. Set “Show Title”, “Show Subtitle”, “Default Difficulty”, “Card Theme”.
- Check the published page. The view script reads HTML data attributes: data-emoji, data-idx, data-opts, data-uid. The block editor preview may not run the same view script.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| Show Title | On/off toggle in the inspector. On by default. Saved as `showTitle`. |
| Show Subtitle | On/off toggle in the inspector. On by default. Saved as `showSubtitle`. |
| Default Difficulty | Select control; the chosen value is saved on the block. Options: Easy (6 pairs, 4×3); Medium (8 pairs, 4×4); Hard (12 pairs, 6×4). block.json default: medium. Saved as `defaultDifficulty`. |
| Card Theme | Select control; the chosen value is saved on the block. Options: Animals 🐶; Food 🍕; Nature 🌸; Space 🚀; Sports ⚽; Symbols ❤️. block.json default: animals. Saved as `defaultTheme`. |
| Flip Delay (ms) | Numeric range control in the inspector. Range 400–2000. block.json default: 900. Saved as `flipDelay`. |
| Show Timer | On/off toggle in the inspector. On by default. Saved as `showTimer`. |
| Show Move Counter | On/off toggle in the inspector. On by default. Saved as `showMoves`. |
| Show Best Score | On/off toggle in the inspector. On by default. Saved as `showBestScore`. |
| Max Width (px) | Numeric range control in the inspector. Range 320–900. block.json default: 620. Saved as `contentMaxWidth`. |
| Accent Color | Color control in the inspector. block.json default: #8b5cf6. Saved as `accentColor`. |
| Card Back | Color control in the inspector. block.json default: #8b5cf6. Saved as `cardBack`. |
| Card Front | Color control in the inspector. block.json default: #ffffff. Saved as `cardFront`. |
| Matched Card | Color control in the inspector. block.json default: #22c55e. Saved as `cardMatched`. |
| Section Background | Color control in the inspector. block.json default: #f5f3ff. Saved as `sectionBg`. |
| Card Background | Color control in the inspector. block.json default: #ffffff. Saved as `cardBg`. |
| Title Color | Color control in the inspector. block.json default: #4c1d95. Saved as `titleColor`. |
| Subtitle Color | Color control in the inspector. block.json default: #6b7280. Saved as `subtitleColor`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-emoji, data-idx, data-opts, data-uid.
- It writes to localStorage in the visitor’s browser, not to wp_options.
When this is the right block
- Interactive card-flip memory matching game with emoji themes, difficulty levels, move counter, timer, and best score tracking — that is the job of Memory Game, not a generic content block.
- Use it when you need the editor control labeled “Show Title”, which exists on this block’s inspector.
- It matches pages about memory, game, cards.
- Inserter grouping: quizzes, games, and click-to-reveal experiences.
Notes from the implementation
viewScript: this folder’s frontend.js is enqueued on the front end for this block.
FAQ
How do I add the Memory Game block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Memory Game”. It sits under Interactive. After insert, open Content and set “Show Title”, “Show Subtitle”, “Default Difficulty”, “Card Theme”.
Where does Memory Game store visitor state?
In localStorage on that browser. Clearing site data resets it. It is not a WordPress user meta field unless render.php says so.
Is the Memory Game Gutenberg block free?
Yes. Memory Game ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style Memory Game to match my theme?
Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Content, Game Settings).
Related interactive blocks
2048 Game
The classic sliding-tile 2048 puzzle. Swipe or use arrow keys to merge tiles and reach the 2048 tile.
Flashcard
Interactive flashcard deck for studying. Click to flip cards, navigate with arrows or buttons, shuffle deck, mark cards as known, and track progress.
Sudoku
Interactive Sudoku puzzle with difficulty levels, hints, mistake tracking, and timer. Full WYSIWYG preview in editor.
Tetris Game
A fully playable Tetris game block. Supports keyboard and on-screen controls, levels, score, and rich style customization.
Word Scramble
Interactive word unscramble game with categories, hints, scoring, and timer. Multiple difficulty levels.
Bingo Card
Interactive 5×5 Bingo card with number calling, win detection, and celebration animations.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Memory Game from the Gutenberg inserter.