daniu54 / earie-treasures

A 2d top-down loot-em-up with horror and stealth elements
0 stars 0 forks source link

Implement fog of war and sight range + gizmos #16

Open Abb4 opened 1 year ago

Abb4 commented 1 year ago

Enemy ai and player should probably be limited in what they can see

I found this article on implementing level shadows/fog of war: https://docs.godotengine.org/en/stable/tutorials/2d/2d_lights_and_shadows.html

These posts explain how to implement vision cones: https://gamedev.stackexchange.com/questions/179626/what-would-be-the-best-way-to-create-a-cone-representing-the-field-of-view-of-an

Note that there seem to be two approaches: polygon based and trigonometry based. I suspect the trigonometry based is a little bit more elegant

Bonus points for implementing gizmos

Bonus points if you implement fog of war that can be cleared (i.e. the in-game character remembers what he saw, even if he stops looking at it)