Next, note that when the the ball moves, there are a couple of items of note. The first is that there is a flame trailing the movement of the bowling ball. In fact, this comes by a "Trail Renderer". This renderer is a bit difficult with a rotating object, so I had to create a separate object that follows the ball in a similar manner to the Ball Camera. In fact, the code is quite similar, I only specify an offset and the object to follow. I'll leave that up as an exercise for the user.
The second item of note on the second chart is the red line that appears. It's a bit difficult to tell from a still photo, but this line follows the touch of a user. This was actually quite a difficult thing to achieve, there are a couple of important things. The first is to have a function that tracks the drag mid-drag. It is set up in the Drag Launcher, and is very similar to the Start and End drag functions. The second key is to set the floor up in a unique layer, and ray trace that layer. The following code assumes that the floor is the only object on the default layer, the 0x1 could be changed to the appropriate max if that is not the case. I put the pins, swiper, and ball in the "Ignore Raycast" layer. Note that this code relies on having the camera, which I passed into the class as is commonly done. "lastLoc" is the last valid position.
private Vector3 GetWorldMouseLocation()
Ray ray = theCamera.ScreenPointToRay(Input.mousePosition);
Vector3 loc=new Vector3();
foreach (RaycastHit vHit in Physics.RaycastAll(ray, 30, 0x1))
loc = vHit.point;
loc.y = 0.1f;
lastLoc = loc;
Beyond that, it's a matter of moving an object with a Trail Renderer component, similar to above.
There are several other features used, such as sound effects, rocket launch effects, explosions, and star skybox, all which add an element of additional fun to the game. I will point those interested in free custom sound effects to an awesome random free sound effect generator, sfxr. To see the final product, please download Missile Bowl from Google Play.
Ben Pearson is the author of the Amateur Radio and other technology blog KD7UIY and developer of Games and Apps at Google Play pearsonartphoto, where he plans to publish some of the games created by inspiration of gamedev.tv. He is currently working on a Sea Trading game, which you can subscribe to updates at his Google Group. He has been a programmer since a young age, although only recently is learning programming with game engines. He has completed the the Complete Unity Developer Course and the Procedural Generation courses, and is working through the Complete Blender Developer Course and Unity Game Physics courses. He is hoping to soon start Unreal Courses soon. Follow him on Twitter @KD7UIY.