How do I make fog of war

  • I need to create a fog of war effect that ties to the player character's line of sight so that the the player can only see what the player could see. This is for a top down view game.

    I tried to use the Line of Sight behavior on the player character and have that correspond to a tilemap on a layer above the player character, but couldn't figure out a way to get the Line of Sight behavior to interact with only individual tiles that it could "see."

  • Well, I'm not very happy with this one, and it certainly isn't efficient. But maybe it will give you some ideas.

  • Well, I'm not very happy with this one, and it certainly isn't efficient. But maybe it will give you some ideas.

    Thank you. I was hoping to not have to do all the individual sprites for the fog of war, but I think I might have to go that route. I was expecting a few more events, so thank you for the capx!

  • Bump.

    So shirokuma's solution is having a layer of tiny sprites that were manually placed and become transparent when in the player's line of sight.

    How do I set it up so that the game places all the sprites automatically at the start of the layout?

  • It can be set up something like this:

  • It can be set up something like this:

    Thank you very much!

    EDIT: Completely unrelated, but how do I link my Construct 2 license to my forum login? I've had Construct 2 for about 9 months now on Steam, but I just signed up for the forums a few days ago.

  • You can request your badge by forwarding your proof of Steam purchase to along with your forum account name.

  • Thank you!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here's a quick edit that doesn't require local variables:

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)