Oh right, that's how it works
So following on from my last post I am happy to say I have achieved all the thins I wanted to and a little it more. I have put in place all the base variables as well as some extra ones that I have worked into calculations for score, health and the enemy's that mean I can add in extra parts to the game like upgrades and health boosts and such if I want to. These have also allowed me to set the enemy's (bombs) that so when they are clreated they will vary in size (this is to give a perspective of distance) and also the size of the bomb dictates it's speed. Closer ones drop faster smaller further away ones drop slower. I also implemented depth on the bombs so closer ones have a lower depth to the further away ones.
This means that the clouds that I also added in that randomly spawn and scroll over the screen can be given different depths and some bombs will appear in front or behind them. Thus also giving the appearance of depth. I also added some explosions for the bombs although I am not 100% happy with these explosions so will be looking to add better ones.
I also got the bombs to register when they hit the ground and add damage to the player and implemented a health bar at the top left of the screen. The issue I had was that for example say you have 100 points of health and each bomb drops you by 10, instead of the health bar animating down the drop in health it just drops in chunks. This meant I had to get creative with some coding and work out a way of tricking it into animating. I tried a couple of different methods all of which didn't work as I had expected but I hit upon an odd strategy hat worked. I created a new variable that fills up with heath that has to be removed e.g. damaged sustained waiting to be taken off. I then created an alert on the actual player object, that is called during the step event in the game that calls an alert every second, the alert then checks if the health is above 0 and the damage to be taken off is also above 0 and if so it then reduces the players health and damage waiting by 1. That way you get a nice animated drop. I will also use this when adding health so the player can see his health rise. Perhaps not the best way to do it, but it achieves my desired end effect.
Currently I have 50% of a game made, we have a player (gun) that can pan left and right, we have enemies that fall from the sky and blow up upon impact of the ground, releasing damage to the player and re-spawn. Also when they re-spawn I have some cool jigery pokery working. So you wont always have the maximum amount of bombs falling at any one give time. i.e. 6 bombs start falling, 3 explode perhaps only 1 respawns, could be 2 or even 3. as each time there is a respawn it checks the amount of current bombs falling and then working out the maximum amount allowed (this can change as the game progresses to increase difficulty). This give the maximum that can be respawned at that time and it then pick how many from 0 to the max to put back on screen. We have explosions, damage as well as the ability to add in power ups later on or extra health as well as clouds to make it look better and a tracker for a score.
This is 50% because next I need to add the ability for the player to fire and shoot down the bombs. Along with that we will have collisions for the bombs/bullets. I will also be adding in a maximum amount of shots the user has before they have to reload, this way it means that the user can't just keep firing and making the game easier for them. This will be pretty easy to implement although I am not sure how I will go about showing how many shots they have available to them. Once all of this is implemented I will need to think about increasing difficulty and at what stages, I think perhaps I will start with the bombs doing less damage and the more you destroy the higher the damage each bomb will do. I think also I may add in an extra speed setting, so the further in you get not only do bombs do more damage but they also will fall faster.
Once those things are added the game itself will be done and I will just need to work out how best to implement load and main menu screens. I am also thinking that once I have a finished game I will start a new project and rebuild it all from scratch using all the code in this file as it also contain a lot of rubbish I added whilst learning to use this program.