2D Game Retrospective
Wow, it has been quite a long time coming; however; I finally did it. It is unbelievable that I could start out with prototyping a game using simple 3D objects: Then replacing those simple 3D objects with the sprites we want to use and adding a background once we are happy with the interactions:
Pickup Collection made easier.
Since we have given some Enemies the ability to destroy the Players Pickups, it is only fair, we make collecting them easier for the Player. To this end, let’s make it so that if the Player is within 6m of a pickup and presses the C key, the pickup will move to the Player at a quicker rate. To accomplish this, we need to add the following code to the Update method of the Powerup script: We, of course, need to add the variable:
We already have an Enemy with a turret which targets and fires at the player. Let’s create an Enemy that knows when it is behind the Player, that will deploy a back facing turret and fire it. To accomplish this, lets create another script called; EnemyWeaponBackFire and add the following: …
Since I have been making this game a little more difficult as I went along, I think I should probably have powerups; such as ammo; spawn more frequently than health and missiles, for instance. This can be accomplished by creating a new Coroutine in the Spawnmanager script, such as: We, of course, will need to add a couple of new variables: