Flashlight or Spotlight Effects using Phaser 3
Flashlight and spotlight effects are created using two images, one on top of the other. With the help of alpha masks in Phaser 3, you can hide the top image to reveal the bottom image when a mouse passes over it.
Flashlight effects are used to reveal hidden or darkened objects in side-scrolling games. We often see flashlight effects as a wedge-shaped ray of light, used by a character of the game.
On the other hand, spotlight effects are often used on top-down games, sometimes on a board style playing field. These effects are depicted as a circular light object that creates a stark contrast with its surroundings.
Check out this article to learn more about alpha masks in Phaser 3.