Sneaky Ninja – More items!

 This week I worked on finishing the final two items for our game, as well as implementing the item selection system, so that players can choose three items to use in the level.


Grappling hook, fire cracker, smoke bomb, shuriken, four of the five items in our game.

The two items I coded are the fire cracker/distraction bomb and the camouflage item. These items where a lot more simple to code smoke bomb and grappling hook I worked on last week. The distraction bomb can be thrown up to two tiles away from the player and will then generate a sound that draws all guards within a certain radius to come and investigate the sound. In order to “simulate” the sound from the bomb I used the same path finding system that we use for the movement in the game, this way sound won’t travel through the walls in the game. The bomb uses the path finder to figure out how far away each guard is and then alerts all guards that are within range of the sound, these guards will then walk towards the source of the sound and then return to their patrol paths if they don’t find anything.
The second item was the camouflage item, this item simply allows the player to become invisible for a number of turns, but only if they don’t move, this item was really simple to code because the support for non transparent tiles is already in the game and could easily be manipulated to support the item.
My final big task for this week was to implement the item selection system that I created earlier so that it could actually be used with our game. The selection system uses a list of items that are simply a name, an icon and a ID number, once the player has selected the items he/she wish to use and starts the level the game will activate the item components in unity corresponding to the item ID.

This was a very short blog post as I have not encountered any big issues during this weeks work.