I'm working on an ARPG, and I'd like to implement a "fading walls" system similar to Diablo II's.

Let's say I have this tilemap, where

  • Black tiles are walls,
  • Brown tiles are floors,
  • White tiles are... nothing.

enter image description here

I could already achieve that every wall is faded which is on the bottom half of the screen. (The player is centered on the screen).

enter image description here

But I don't want to hide the walls further away from the camera than the player, even if it's on the bottom half of the screen. (Marked with red, above)

For this, I decided to calculate every walls' "inwards direction".

And the walls with inward direction pointing downwards on the screen are always shown, even if they are on the bottom half of the screen

Every wall already has their neighbours' type stored because I use them to determine their visuals.

Could you help me in figuring out a nice way to do this?

Or maybe the better question would be: how to nicely implement a Diablo II like wall fading system? :|

  • \$\begingroup\$ Sounds like the dot product could solve this issue. \$\endgroup\$ May 19, 2022 at 3:33
  • \$\begingroup\$ @ChrisSprance Could you elaborate please? :) \$\endgroup\$
    – Tudvari
    May 20, 2022 at 5:37


You must log in to answer this question.

Browse other questions tagged .