Match-3 Puzzle - Pygame Grid Matching Game

Description
Match-3 Puzzle is a complete, timed grid-matching game built with Python and Pygame. Players click a tile and then an adjacent tile to swap them — matching 3 or more same-colored tiles in a row or column clears them, drops the remaining tiles down, and refills the grid from the top, all within a fast 90-second countdown.
The game features a smart 8x8 grid generator that guarantees no pre-existing matches at the start, real match detection across rows and columns, automatic chain-reaction scoring (cascading matches from refills keep adding to the score in a single move), invalid-move handling (tiles swap back if no match is made), a clean circular tile design with selection highlighting, a live score and countdown timer with a color warning in the final seconds, and a "Time's Up" end screen with instant restart. The code is compact and cleanly structured around pure grid-logic functions (match finding, collapse/refill, adjacency checks), making it easy to reskin with new tile art or extend with power-ups.
Demo:
============================================================== 🧩 MATCH-3 PUZZLE - GAME DEMO ==============================================================
🎮 Objective: Match 3 or more tiles of the same color by swapping adjacent tiles before the timer reaches zero.
-------------------------------------------------------------- GAME START --------------------------------------------------------------
Score : 0 Time : 90 Seconds
🔴 🔵 🟢 🟡 🟣 🟠 🔴 🔵 🟢 🔴 🔵 🟢 🟡 🔴 🟣 🟠 🟡 🟢 🔴 🔴 🔴 🔵 🟠 🟣 🟣 🟠 🟢 🔵 🟡 🟢 🔴 🟡 🔵 🟡 🟠 🟣 🔴 🔵 🟢 🟠 🔴 🔵 🟢 🟡 🟣 🟠 🔴 🔵 🟢 🔴 🟡 🔵 🟠 🟢 🟣 🔴 🟠 🟣 🔵 🟢 🔴 🟡 🔵 🟢
Player selects two neighboring tiles.
-------------------------------------------------------------- SUCCESSFUL MATCH --------------------------------------------------------------
Swap:
🔴 🔴 ⇄ 🔴 🟢
Result:
💥 💥 💥
3 Matching Tiles Cleared ✔
New Tiles Drop Automatically ⬇
Score : +30
-------------------------------------------------------------- CHAIN COMBO BONUS --------------------------------------------------------------
💥 First Match ⬇ 💥 Second Match ⬇ 💥 Third Match
Combo Bonus Activated ✔
Score : 120
-------------------------------------------------------------- TIMER RUNNING --------------------------------------------------------------
Score : 380
Time Remaining
██████████████████░░░░ 20 sec
Player must make quick decisions to earn the highest possible score.
-------------------------------------------------------------- TIME'S UP --------------------------------------------------------------
⏰ TIME'S UP ⏰
Final Score : 560
🏆 Excellent Performance!
Press [ R ] to Play Again
============================================================== Controls: 🖱 Mouse Click → Select Tile 🖱 Mouse Click → Select Adjacent Tile to Swap ESC → Exit Game R → Restart After Time's Up ==============================================================
Features
Classic click-to-swap match-3 mechanics8x8 grid with 6 tile colorsSmart grid generation — no free matches at game startAutomatic match detection (rows + columns, 3 or more)Cascading combo scoring on chain reactionsInvalid swap auto-reverts90-second countdown timer with low-time warning colorLive score displayTime's Up screen with one-key restartClean, function-based, single-file Python code — easy to reskin or extendRequirements
Python 3.7+Pygame library (pip install pygame)No internet connection or external assets required — runs entirely offline
Instructions
Install Python 3.7 or higher.Install Pygame:pip install pygameRun the script: python 5_match3_puzzle.pyControls:
- Mouse Click — Select a tile, then click an adjacent tile to swap
- ESC — Quit
- R — Restart after Time's Up
| Author | Airo09 |
|---|---|
| Category | Scripts & Code / Python |
| Price | $14 |
| Extended License | $42 |
| First Release | Jul 25, 2026 |
| Last Update | Jul 25, 2026 |
| Files included | .py |
Categories
Tags
External listing. code.market does not sell this product and does not process payment for it. Pricing, payment, delivery, licensing, refunds, and support are handled by the third-party merchant on its own website. We may earn an affiliate commission from a referral. Details.
Products of the Week.
Submit🥇
Free LinkedIn Likes From Real Members | LinkedInLikes
Get free LinkedIn likes on your posts from real members who react by hand. No password needed: you only share a link.
Website · 12,847 views · 46 clicksWebsite · Week 49 · 12,847 views · 46 clicks
🥈
Free Medium Claps From Real Writers | MediumPlace
Free Medium claps on your stories from verified accounts of real writers, each given by hand. No bots, no Medium password, nothing to pay. Paste a link.
Website · 7,964 views · 10 clicksWebsite · Week 49 · 7,964 views · 10 clicks
🥉
Free GitHub Stars From Real Developers | GitWow
Get free GitHub stars on your repository from real developers who star by hand. No token or password, and it's free.
Website · 15,624 views · 28 clicksWebsite · Week 49 · 15,624 views · 28 clicks
#4
Free Substack Likes From Real Writers | StackRooms
Free Substack likes on your posts and Notes from verified accounts of real writers, given by hand. Free to ask, free to receive. Just share a link.
Website · 7,784 views · 2 clicksWebsite · Week 49 · 7,784 views · 2 clicks
#5
Free Twitter Likes From Real People | SupaTwitter
Free Twitter likes on your tweets from verified accounts of real people, each given by hand. No bots, no Twitter password, nothing to pay. Paste a link.
Website · 7,679 views · 4 clicksWebsite · Week 49 · 7,679 views · 4 clicks
#6
Free X Likes From Real People, Given by Hand | XFast
Free X likes on your posts from verified accounts of real people, each one given by hand. No bots, no X password, no conditions. Paste a link to start.
Website · 7,591 views · 0 clicksWebsite · Week 49 · 7,591 views · 0 clicks