How to create light and darkness using ray casting and polygon visibility.

Posted on 7th May 2021. Follow @phaser_ and get the Phaser World newsletter.


Emanuele Feronato writes: "I always try to be responsive to the feedback from my readers, so when I saw one of you was in trouble with the porting of light and dark using ray casting and visibility polygons to Phaser 3, I decided to update the script.

With ray casting you can play with light and shadow in real time. Look at this HTML5 example powered by Phaser and Byron Knollā€˜s visibility polygon script. Commented source code available."

Read More

Learn to code and lead your intrepid crew on a mission to save The Cloud in TwilioQuest, a PC role-playing game inspired by classics of the 16-bit era. Free forever, and available now for Windows, Mac, and Linux.

The first book on the creation of HTML5 cross platform games using Phaser 3 and other free software.
  • By Emanuele Feronato
  • 155 Pages
  • 28 Source Code Examples
  • Build a complete game from start to finish
  • Cross Platform
  • Scaling for devices
Buy Now