We are now going to destroy an enemy by spawning laser beams when we fire our spaceship. We will then use collision detection to detect when the laser beams hit the enemy ship. As soon as the enemy ship is hit, it will be destroyed.
We start a new project and add the spaceship image
Rocket.png that we used previously; we will now add laser beams by using the following image:
Let's destroy the enemy by executing the following steps:
laserbeamsprite to it.