As I wanted the game to be single player, I then needed to add some enimies. I desided to used the same health script as the tank, as it was layer dependent. This means, the bullets would only effect objects in the enemy layer. I then used a look at/ transform script to make them chase the player, and a damage code so that they slowly take away the player's health. I has to make my own turret controls as the tutorial only had the tanks world movement. I used a simpler method as the point and click game, in that I make a code that follows the mouse position. I attached that to a invisible game object, the make the turret look at that object. This alows it to pivot and aim separably from the tank.
I desided to make the enemies to attack like this insetd of shooting as that would require much more complex coding, which would take much more time. I then found I spawn code that uses an aray of spawn points and instantiates enemies randomly. I then made a code simler to this to make an item drop code, which drops power ups when a enaey dies.
For the power ups, I did a health pack and different weapons/ammunition. The first one I made was a bomb weapon. I used the same shell code, but changed the virables so that the bomb would be more powerful and have a wider exploitation range. I then wanted to make a fast shooting power up that was more like a machen gun then a tank shell. This ment I had to make a new shell movement script, as the original one gose further based on how long the fire button is pressed, and is also effected by gravity. So I made one that makes the shell just fire straight, but this ment I also had to make a second fire transform as the first one is slanted up so the shells arc.
I also wanted to make a second kind of enemy, so I used the tank turret codes to make a enemy turret as well.
No comments:
Post a Comment