Bloom Barrage was first conceived as a multi-player game where players used game-pad controllers to play against each other. After the successful prototype we decided to add touchscreen support to the game. Adding touch support proved to be a bit more time consuming than anticipated.
Initially the plan was to just put an onscreen joystick that players could use to control their character along with a single button. Something like this:
However, after soliciting feedback from the local Portland Indie Game Squad community about enabling touch on games we decided to go in another direction. We implemented touch controls as follows: tap to move your character, swipe to throw a seed, and tap self to plant seeds in the garden (See video below). Although this takes a bit of training for the user we are pretty happy with the result. Also, this control scheme helps avoid the claw hand strain you might get from long play sessions.
OK, easy enough to add this different control scheme you might say. Sure, it wasn’t a big deal but there is a rather large side effect of this different control scheme: path-finding. The new scheme allows you to tap anywhere on the map and your character just moves there but what if there are obstacles in the way? We now needed to implement path-finding for the new control scheme to truly work as expected.
Although our path-finding requirements were pretty simple, since this is a 2D game and there are limited obstacles, we looked to the Unity3D Asset Store for options and found Aron Granberg’s A* Pathfinding project. Wow, what an incredible asset! This thing is well documented and has 3+ ways to implement your path-finding. We were able to get path-finding up and running after a very short period using the grid graphs feature. Really, you could just check out the website documentation linked above and learn a ton about path-finding techniques; cool stuff.