top of page

Match-3 System

Introduction:

A personal project trying to build the match-3 system used by the popular Japanese puzzle game "Puzzle & Dragons" in Unity3D. Allow user to set their own matching rules, adding new colors etc.

 

Engine:

Unity3D

 

Website:

Unity Asset Store

 

Platform:

PC

 

Features:

  1. Combo checking and cancelling

  2. Support adj2, adj3 and gt adj3

  3. 2 adj combos with same color are combined as 1

  4. Ball swapping in 8 directions

  5. Timer start after first swap

  6. Customizable settings

Details:

Setup the first board so there are no match on start-up. Scan through the entire board after player input for match, if found, destroy the matching balls, record the information and move on.

 

ComboBall.cs (With custom editor)

The fundamental component of this project, the combo balls, contains information like the color of the ball, the condition of the ball, etc. User can change the ball color in runtime by select a different Ball Color in the drop down list and click “Apply Color Change”. You can add more color by modifying the enum “BallColor” in this class.  

 

ComboBallController.cs

An interface for other components to interact with the combo ball.  

 

ComboMatrix.cs

A 2-D matrix of combo balls, also store information like the size of the balls, number of rows and columns, etc.  

  

ComboMatrixController.cs

Where the combo checking logic is implemented  

Currently only 3 cancel rules are supported:

    Adj2:  

        2 or more adjacent balls with the same color are considered as a combo.

    Adj3:

        3 or more balls with the same color in a row or column are considered as a combo.

    AdjGT3:

        Similar to Adj3, only this time only more than 3 balls in a row or column are considered as a combo

 

GameController.cs

Main game loop.

bottom of page