Created a Boss battle prototype
This time, I decided to do a programming exercise of a simple boss battle which will prepare me to make more complex boss battles for my future games. Normally I would prefer making it into an fps project battle boss, but I decided to do it similarly to a tank shooter-styled game to learn different ways of mechanics to use for my future games.
WHAT I AM DEMONSTRATING:
• Player can move backward and forwards and rotate around.
• Player can shoot orbs from in front of him instead of using ray casts.
• The turret boss can aim and shoot cannonballs at the player wherever he is.
• The turret boss randomizes a minimum and maximum shoot force and fire rate.
• Both the player and the turret boss have health which determines the win-or-lose factor of the game.
WHAT I LEARNED:
• Assigning game object variables with nulls is a good way to reduce errors when starting the project, except when they are called by in script by methods, awakes, or updates.
• Making game objects flash by mesh renderer when damaged then back to their original color which was stored in the awake function.
• Getting object references from projectiles by using their game object name instead of tags.
• Made simple particles for the cannonball and magic orbs. For the orbs, they combine lots of particles to make 1 orb.
• Adding relative force to Cannonball’s rigid body relative to its coordinative system.
• The difference between PlayOneshot audio parameters compared with play Audios.
• Getting the turret to randomize with Random.range with fire rate and force of cannonballs respectfully.
• Not getting the UI methods in the update function otherwise it wastes performance in the game manager.
• Static variables can be saved in the game Manager and be updated whenever called from other scripts.
• For orbs, I can use the audio length to play a certain sound before self-destroying the game object. Making sure the audio plays its full sound without cutting off.
OVERALL:
It was a nice and short exercise, I think usually boss battles are a bit more complex than this one, but I learned different ways of making mechanics that will be useful for my toolbelt in future development.
Commentaires