Now that I have the path on screen, shooting the bullet is quite easy. I can use the same path to move the bullet on the screen. So after the user selects a path and releases the touch on the screen, we activate a bullet gameObject, and animated it along that path.
In the last step we collected the collision points, through a series of ray casts, and now we’re ready to use these points to draw a dotted line demonstrating the bullet’s path.
Here’s the RayCastShooter class with the updates:
This time, building on the previous series of tutorials on match three games, I’ll go over how to build a bubble shooter game. There are a number of ways to go about this, using a grid, or not using a grid, using physics or not using physics… I’ll show you one way of doing it, explaining the basics so you can extend to meet your game idea needs.
The one thing left to explain is what to do if you want to remove not only the group of matched balls but all balls of the same type which are connected to the original match group.
Sounds more complicated than it is. All you need is one extra check wherever in your logic you first create the matchList.
This is the most complicated of the types of Match Three games I’ve shown so far. The player can drag any ball either vertically or horizontally and when the ball is dropped the player can swap with any other ball in either the same row, or in the same column depending in which direction the player is dragging. There are no refreshes, the grid is finite, AND the grid must then collapse sideways.