Draw cone of vision to use with LOS

  • Hello,

    I am creating a stealth game. Everything works like a charm.

    How to I draw a cone of vision for each guard in my levels? Like in Commandos for instance, where the cone of vision is reduced where blocked by an obstacle.

    Since C3 is obviously drawing such a cone in the background couldn't we have a function to display the cone, that would help the player knowing where and where not to move.

    Any ideas welcome, thanks!

  • I managed to do this with ShadowCaster and blend mode, check out this post:

  • I managed to do this with ShadowCaster and blend mode, check out this post:

    This is EXACTLY what I wanted, thank you so much!!!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I managed to do this with ShadowCaster and blend mode, check out this post:

    Works like a charm I managed to incorporate it in my game. BUT could it work for multiple enemies? I want the guard to show their line of sight. If I try to use more than one light&fov it doesn't seem to work.

    Any idea?

  • melomaniak

    It's possible, but every enemy (with its own shadow light and FOV sprite) should be on a separate layer.

    Making hundreds of layers for all enemies is a bad idea, of course. But if in you game there are only a few enemies visible on the screen at a time, I guess you can make 10 such layers. Once an enemy appears on the screen, move it to an unoccupied layer and pin one shadow light and one FOV to it. When the enemy is killed or walks away from the screen, move it to some other layer and destroy its shadow light and FOV.

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