It finally became necessary to tackle the weapon situation. And so this week as well as a few tweaks here and there I made a start on the gun play.
Firstly there were a few tweaks I needed to sort out. The save game routine needed to have the trinket information added to it so we can display those collectables later on should the player be interested (first sort of achievement situation).
And there was a small glitch with using inventory items such as keys on locked doors. I had noticed that if you used the key at any point (didn’t matter if you were miles away from the door it unlocked) it would unlock the door in question which is obviously not what I wanted. So, I needed to adjust the interaction code a little so that the key only operated when you were actually in a position to use it.
And so it was on to the gun.
First up I wanted to have 2 visual queues that you were holding a weapon, the mouse cursor circle would change to a target crosshair, and a targeting line would project from the player to give an impression as to the angle the gun would fire. I will also be adding the gun to the players hands so you can actually see the weapon. Finally the player will not be able to interact with the environment (interaction circles will show but they will not change to an action icon whilst holding a gun) and he will also not be able to run.
Next up was the actual projectile. The first gun is a dart gun so the darts cannot fire as far as say a bullet would and so it leaves the player at speed and slows down to a stop, unless it hits a wall or something. Once it’s stopped it becomes inactive so it can’t hurt anything and eventually fades out (to avoid there being too many sprites).
The player will have a limited number of darts so they will not want to waste them, I haven’t as yet decided on the number at present but I suspect a 12 dart magazine will be a good starting point.
Once I’ve finished the other aspects of the gun; player holding weapon, etc. I can finish off the last few bits of the floor and then we’re onto the next section of the game!