Original Post
[font="Calibri"][font="arial, verdana, tahoma, sans-serif"][font="Calibri"]Okay, so I have a simple 2D tile-based top-down game.[/font]
[font="Calibri"]I have these guards that are trying to spot the player. They have a field of view that I want to represent as a flashlight glow that lights up the area. This area will be where the guard can see, so I'll also need to detect if the player is inside one of the guards' views. Tiles can also block their vision.[/font]
[font="Calibri"]I guess I want something to look like this:[/font]
[font="Calibri"][attachment=2975:flashlight_vision.png]
[/font]
[font="Calibri"]I've seen stuff about ray tracing or field of view, but I'm not sure where exactly to start first. [/font][/font][/font]
[font="Calibri"]I have these guards that are trying to spot the player. They have a field of view that I want to represent as a flashlight glow that lights up the area. This area will be where the guard can see, so I'll also need to detect if the player is inside one of the guards' views. Tiles can also block their vision.[/font]
[font="Calibri"]I guess I want something to look like this:[/font]
[font="Calibri"][attachment=2975:flashlight_vision.png]
[/font]
[font="Calibri"]I've seen stuff about ray tracing or field of view, but I'm not sure where exactly to start first. [/font][/font][/font]