Time to re-work, again!

I had a lot of plans for coding the game this weekend as next week/weekend I am away for 3-4 days and won't get much of anything done. Unfortunately I did not get much of anything done this weekend, Saturday was spent mostly doing gardening so I was left with a couple of hours on Sunday to get some work done. Because of my time limits I was not sure what to work on, so I started with trying to get a the warning for the reload working the way I wanted it to. So it would fade in and out red. Sounds easy, should be easy but for some reason even after re-working the code 4 times it still would not work the way I wanted all of the time. Sometimes it would exit the co-routine and instead of the screen being clear you could still see a bit of a red tinge to it. Other times instead of only going to an opacity of 0.6 it was jumping up to 0.9 even thought the code told it not to do this.

I think this was because the co-routine was getting kicked off more than once even though the code should not have allowed for that. The end result was it worked right about 50% of the time, the other times it would do some weird and wonderful things. Just as I felt I had wasted 2 hours and was about to give up I managed to get it working by doing one little thing different, this worked well and meant that it worked as expected 100% of the time that I have since tested it.

Unfortunately though I have ran into a similar issue with the bombs as they drop and get hit. Every now and again one goes a bit off track and continues to fall from the sky playing the wrong animation (the exploding one) during this phase you cant shoot it but if it hits the ground everything works as expected (damage is received and it resets back to the top of the screen). You would expect that this re-sets it properly but it does not, the bomb will continue to repeat the previous falling explosions process and there is nothing you can do about this. So because of this I am now thinking I need to re-write and re-work the bomb code. So instead of re-setting the bomb I am most likely going to destroy the game object and then just get a loop to create a new bomb. This seems a bit over kill and for that reason I had avoided doing this in the first place as it seemed better to just re-use the game object rather than destroy and re-create. This will take a bit of tweaking and some new code will be needed in the main game controller to handle the creation of the bombs and maintaining the right amount of bombs in any current game. Nothing taxing but it does mean going back and re-working code I already have and having to add and test all over again unfortunately.

>>back<<