Join Kelley Hecker for an in-depth discussion in this video Clear all the colors, part of Building a Match 3 Game with Unity.
- [Voiceover] Now that we've created…our rainbow piece prefab, we need to have the grid…clear all the pieces of a certain color,…and also spawn the rainbow piece…when the player matches five or more pieces.…Open the Grid script.…Add a new function called ClearColor,…which takes in the color to be cleared.…This function will loop through all the pieces in the grid.…We first check if the piece is colored.…If it is, we check if the color of the piece…matches the color passed into the function.…
Or, we check if the color passed in is Any.…If we pass in the color Any, it can clear any piece.…If the piece is a match, we clear it.…Open the ClearColorPiece script.…We'll finish filling out the clear function.…Call the ClearColor function we just added…to the Grid class.…In the Grid class, go to where we spawned…the row- and column-clearing pieces…and ClearAllValidMatches.…
If count has at least five pieces in it,…we'll create a rainbow piece.…Rather than setting the color of the special piece…to the color of the matched piece,…
Game developer Kelley Hecker covers topics like creating a grid-based game board, using inheritance to create different types of game pieces, adding obstacles and new levels, detecting matches and clearing pieces, and implementing a user interface complete with a score screen. By the end of the course, members will have a completed game and learned new techniques to apply to their next Unity project.
- Creating a game board grid
- Creating and scripting game pieces
- Filling the board
- Creating obstacles
- Swapping pieces
- Matching pieces
- Clearing obstacles and pieces
- Creating new levels
- Creating the user interface: HUD, game over screen, etc.
Skill Level Intermediate
Creating Mobile Games with Unitywith Kelley Hecker1h 12m Intermediate
Build a Real-Time Strategy Game with Unity 5with Dan Violet Sagmiller3h 47m Intermediate
1. The Game Board
2. Make a Move
3. Special Piece Types
4. Level Types
5. User Interface
Next steps1m 29s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.