Let's discuss and take a look at how we can add spotlights to our game. We've looked at directional lights, we've looked at point lights. Directional lights have a direction but they don't have an original position, so they are infinitely far away. A point light has a position but it shines light in every single direction, whereas a spotlight has a position and a direction.
Take a look at the following diagram of a spotlight:
So, the position of the light is high up somewhere, and you can also see that there is a direction for the light. It essentially creates a cone-like effect, sort of what a lamp or a torch would do. Spotlights are used on stages. But spotlights are used in several scenarios in games throughout your world.
So, without further ado, let's get on with coding our spotlights.