Posted May 14, 2024 by Eighthsum9798
for this week, i have been working on one of the extra features i wanted in my game which was in my original design. this was to have the enemies shoot back at the player to increase difficulty of the game.
i had started by creating a quick prefab of the enemy projectile and adding a empty object in one of the enemy sprite prefabs. i began the coding of the shooting where i intended on having the bullets fire at random intervals, moving left towards the player.
initially i encountered a slight issue once i tested it. there was no cooldown system so a stream of projectiles poured out of the enemy ship. although quite funny at first it needed to be rectified. with that corrected i then worked on having the bullets damage the player which was just adding that to the health manager code.
i thought this was all completed until i noticed that when the players projectiles collide with the enemy projectiles, this increases the score. but this was actually an easy fix where i added a check to see if it hit an enemy projectile.