Learn how to only show what is visible around the player with this field of view algorithm tutorial.

Posted on 28th Jul 2021. Follow @phaser_ and get the Phaser World newsletter.

image

Tommy Leung from Ourcade writes: "Are you are making a roguelike or dungeon crawler?

Do you want the player to only see what is visible based on where they are standing?

Where enemies or items behind a wall, in the next room, or around the corner should be hidden until the player has line of sight?

Then what you need is a proper field of view algorithm.

Another alternative is this simpler fog of war effect if you don't need a proper field of view..

In this article, we will go over using the MRPAS algorithm to implement a field of view effect in Phaser 3 with tilemaps."

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
$19