Sneaky Ninja – Alpha bug hunt & items!

The first part of last week was spent on hunting down and eliminating some pretty nasty game breaking bugs in our code. We wanted to fix these bugs before we started working on the final feature we needed for our alpha, the items. Writing and reading about bug fixing is not very fun or interesting so I’ll tell you more about the second part of the week instead, where we implemented the three items we decided to use for our alpha, the smoke bomb, grappling hook and shuriken. 

Concept art for the shuriken and grappling hook.
The items I coded where the smoke bomb and the grappling hook. The smoke bomb works by simply pressing the item icon in the HUD which would make the player throw a smoke bomb at his feet making the current tile he’s standing on and the four adjacent tiles fill with smoke for two turns. Guards can’t see through the smoke letting the player escape unnoticed. 
The grappling hook is a bit more complicated, the player clicks the item in the HUD to select it, he can then click an tile adjacent to the player character that contains a wall, the player character would then climb over the wall to the other side. 
Implementing the smoke bomb was relatively easy, we already had code for making tiles “blocked” so that guards can’t see through them, the only problem I encountered was when I tried to make the tile only blocked for a certain amount of turns, we did not have any way to check what the turn the games was in and so I implemented a quick variable that stored what turn it is, when I had done this it was very easy to make tiles blocked only for a certain amount of time. A pretty stupid mistake I made was that I when testing the smoke bomb in my Unity scene I only changed the colour of the tiles that the smoke bomb was effecting in order to show the effect instead of adding the smoke effect created by our artists. When we ported the smoke bomb into the alpha scene where we had real textures on the floor tiles it was not possible to see what the smoke bomb was affecting. I did not have time to fix this before we had to show the alpha so this is something I will work on this week, I will also add the animation for when the player is throwing the smoke bomb, this animation is not done yet therefore I could not add it to the alpha.