In a video game, you always want to give your players as much information about what is happening to their character on screen as possible. Maybe that means a sound that plays when they collect items, an animation that plays when they use their weapon, or a score counter in the upper corner.
We need to add a way for the player to know whether or not they have been hit. This will be done by having the X-Wing perform a flashing animation after being hit. This has the added bonus of giving you a few frames of invincibility while it’s happening.