Join Kelley Hecker for an in-depth discussion in this video Fill the board around obstacles, part of Building a Match 3 Game with Unity.
- [Voiceover] In addition to moving straight down…to fill a space, pieces can also move diagonally.…This lets pieces fill in under obstacles.…We're going to update the FillStep function…to also move pieces diagonally.…In the Grid script, we're going to add…a new private boolean called Inverse.…If pieces can fill diagonally, it means there may be…more than one piece that could potentially fill…an empty space.…Since we don't always want the diagonal piece…to come from the same direction,…we'll swap the direction we're traversing the grid in…every step, and keep track of which way we're going…using Inverse.…
Now we just swap Inverse after every call to FillStep.…Next, we'll update our loop in FillStep…so that we can change our direction of traversal,…depending on the value of Inverse.…I'm changing X to loopX.…We'll use this value to calculate the actual X coordinate…of our piece.…If we're not inverted, X is simply equal to loopX.…If we are inverted, then X is equal…to the X dimensions minus one, minus loopX.…
Essentially, when we're not inverted,…
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
Unity 5: 2D Essential Training (2015)with Jesse Freeman3h 22m Intermediate
Creating Mobile Games with Unitywith Kelley Hecker1h 12m Intermediate
Build a Real-Time Strategy Game with Unity 5with Dan Violet Sagmiller3h 46m 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.