Simu Cafe Match 3
Implemented a system to handle interaction between states in match 3 game using gamestate pattern
Optimized core matching mechanic to support any match pattern with less intensive calculation.
Created Auto Tile Generator using rule-based to help designers create any tile map from spreadsheet.
Game State
Implementation
State == WaitForInput
If Input
State = Checking
State == Checking
If Match
Add Match pieces to breaking_list (origin , pieces[], break_type)
State = Resolving
Else No Match
State = WaitForInput
State == Resolving
For each : breaking_list
Spawn effect based on break_type
Remove pieces
Add position to update list
State = Repositioning
State == Repositioning
For each : update_list
Each position in update_list
If (has piece above [row-1][column])
Move piece above down to current piece
Add position above to update_list [x][y-1]
If Win
Exit with Win
Else If DeadLock
State = DeadLock
Else
State = Checking
State == DeadLock
Reset Board
State = WaitForInput