
The journey of a thousand miles begins with the first step!
What you need to know first!
How to use SavePoints, compare text files, and ask for help!
In this lecture, we will create a new Unity project and discuss the various naming conventions used in our scripted components.
Here we setup the game board and create the background tiles.
Let's make an orthographic camera that stays centered on our Board.
We extend the Tile component, which is the building block of our Board, in this short lecture.
The GamePiece class describes the playable components that can be moved around the Board to make the matches.
Let's create methods on the GamePiece to allow it to move around the Board.
Here we explore some basic interpolation types to make the movement seem a little more natural.
Here we add the ability to interpret our mouse clicks and drags over the game board's tiles.
Let's code the basic ability to swap a GamePiece with its neighbor.
Here we create a basic method on the Board class to detect matching pieces.
Here we make some functions that wrap around FindMatches that help us find matching pieces in the horizontal or vertical direction. We also make a simple Highlight method to help us visual the matching process.
We use the newly created FindMatchesAt method in conjunction with our SwitchTiles to test if we make a match when we swap GamePieces.
We create the ClearPieceAt method, which will be used to remove matching GamePieces from our Board.
Once we have cleared out some GamePieces, we need to collapse the columns to fill in any "holes" that form.
We need to collapse our Board recursively so we can clear out any "chain reaction" matches that form.
Let's adjust our collapse speed so that it varies according to the distance the GamePiece falls.
Now that our columns are collapsed to fill in the gaps, we modify the FillBoard method to fill in the partially empty Board.
Let's make a special Tile that acts like a hole or obstacle.
Let's make tiles that can be "broken."
We create some simple geometric particle effects to represent clearing GamePieces or breaking Tiles.
We create a ParticleManager so we can trigger our ParticleSystems on certain game conditions.
We trigger our ParticleSystems when we clear the GamePieces or break the Tiles.
We add an array of GamePieces that we can use to customize the starting configuration of our Board.
Implement bomb behaviors in a Unity match-three puzzle game. Build get bomb pieces to clear affected pieces by column, adjacent, and other bombs, updating the clear and collapse routine.
Implement a change color method on game pieces to synchronize bomb colors and match values with the piece they swap, ensuring bombs reflect four-match outcomes.
Set up the bomb effects prefab, instantiate at piece coordinates, and play the bomb particle effect; update the clear pieces routine to use two lists for bombed and regular pieces.
Learn to implement color bombs in a Unity match-three puzzle, creating a color bomb prefab, detecting color matches, and clearing the board when five in a row triggers.
Introduce two collectibles—one non-matching, bottom-clearing piece and a blocker destroyed by bombs but not matchable—and implement a collectible class derived from game piece with match value none.
We create a generic singleton class that can be used for our manager scripts.
Who's keeping score?
Let's invoke the methods on the ScoreManager in the GamePiece, GameManager and Board classes.
Let's make a simple Image that can cover our screen and fade in and out to help with transitions.
Let's make a manager class to keep track of our game's sequence of events. Everything has a beginning, middle and end!
We can count our moves and lose the game now.
We lay out some UI elements to make a small message box.
We create two classes to control our new dialog box, the RectXformMover to move the window on and off screen and the MessageWindow class to control the text displayed.
Now we put everything together from the last two lessons and make the GameManager talk to the Message Window.
Let's trigger the message window if you win or lose the game.
We make a manager class to store and playback sounds.
Let's finish the SoundManager!
Let's tweak our game so it's more friendly for a mobile device.
Download Xcode and get your Apple Developer account setup. We need to provision our devices before we go back to Unity.
Note: this lesson does not contain a Save Point.
Download Android Studio and setup your device drivers to be debuggable via USB.
Note: this lesson does not contain a Save Point. Your individual system settings may vary depending on platform and SDK version.
Here we modify the Player Settings in Unity to accommodate the needs of our mobile platform.
We build our game for iOS!
Note: You will need to add your iOS Development Team ID from your Apple Developer account in order to Build the project from the SavePoint.
We build the game for Android!
Note: you must choose the paths to your Android SDK and Java SDK in the Unity > Preferences in order to build your project from the SavePoint.
Here is the final project with comments added in-line.
Learn how to reskin a Unity match-three game by swapping seven colored sprites, setting up bomb variants, and importing assets to refresh visuals while keeping core gameplay intact.
In this Update, we add a small delay before the EndGameRoutine in the main game loop to wait for the Board to finish its refill.
Fixes in the board class address a lingering yellow warning and a red no reference exception by removing unused code and introducing integer-based collapse logic.
Detect deadlock on a Unity match-three board by testing every position for possible matches and resetting the board when no moves exist, using a board deadlock component and helpers.
Implement has move at and is deadlocked checks to detect available moves on a match-3 Unity board, using row or column lists, minimum matches, and debug output.
Automatically detect and resolve deadlock in a Unity match-three board by clearing and refilling the board, pausing for visual clarity, and adding optional effects while testing obstacle tiles.
Learn to shuffle a match-three board in Unity by filling the board from a preset list, using an unused pieces queue, and applying clear-and-refill or shuffle routines to avoid matches.
Refactor the match-three Unity game by introducing a singleton level goal component to manage moves left and score goals, including a one to three star scoring system and score thresholds.
Refactor the game manager by introducing an abstract level goal and implement is winner and is game over in subclasses, moving scoring to the game manager and updating score stars.
Create a score meter UI in Unity by adding a bottom panel slider that grows with points and triggers score stars with particle effects and sounds when goals are reached.
design and activate a score star and score meter in Unity, triggering icon highlighting, particle effects, and sound, and manage their behavior with scripts and a gauge-like slider.
Implement a level goal timed in Unity by inheriting from level goal, tracking time left with a countdown, and handling is winner and is game over.
Implement and wire level collection goals in a Unity match-three game, using a goals array and goal-complete checks. Drive win and game over through score, moves, and completed goals.
Fix a bug in the board switch tiles routine where last-move collection goals fail to update, by awaiting the clear and refill board coroutine.
This is a small correction to the UIManager from Part1
Refactor a Unity UI system by toggling timer and moves counter via a shared UI manager, adding a dual mode for level goals and consolidating UI layout.
Refactor the message window by moving icons from the game manager, add wrapper methods for score, win, and lose messages, and support level complete and level failed prompts.
Add a second collection goal layout to the message window and refactor the UI manager to pass layouts and spacing as parameters for reusable, multi-layout collection goals in Unity.
Add three boosters to a match-three game: zap a piece, add time, or drop a color bomb; primed boosters pause gameplay and only one can be active, using Unity events.
Learn to build a booster class in Unity with C#, implementing begin drag, drag, and end drag handlers, toggle state, and wire UI text for a draggable booster icon.
This is a sample project in response to a Q&A about using PlayerPrefs to keep track of a value. In this example, we use it to keep track of a high score, though normally it not safe to use PlayerPrefs to store important data like this.
Note: though much of the course was recorded with an older version of Unity, the final project has been updated to use Unity 2019.
Though there are minor differences in the UI, you should be able to complete the course using Unity 2019.
We have created several advanced features to make this the most complete course on designing a Match-Three course in Unity:
re-skinning your game using your own Sprites
checking for the deadlock condition (no more available moves)
shuffling the Board pieces (instead of deleting them and re-filling the Board)
building a one-, two-, or three-star score meter
creating new level objectives (scored, timed, and collected)
This course now weighs in at a 16+ hour marathon in game development. Save weeks of work on building your own match three game.
Join the ever growing ranks of our class and see what you can build today!
In this course, we will:
start with a blank Unity project and flesh out a fully working game level
learn some fundamental techniques for creating your own tile-based match-three puzzle game
follow several C# scripts line-by-line and learn how to organize our scripts logically and cleanly
What is covered:
Setup our project settings and environment
Create a Board class to store our tiles and game pieces
Create an auto-centered orthographic camera
Make a GamePiece class that can move with interpolation
Setup the tiles to receive mouse input
Search for matches in a two-dimensional array
Handle recursive calls to clear and refill our Board
Add sound effects to game events
Apply particle effects to add some punch to our graphics
Making a score manager to track player progress
Join the democratization of game development! Level up your Unity 3D skills and build your own match-three game today!
When you complete the class, you should have a full set of source code as a starting point for your match-three puzzle game!