Don't render moving entities that aren't visible
When the character walks away from or around the corner from entities that move such that they're no longer visible, stop rendering them. Still render static entities like walls, doors, and items though. This prevents entities walking into a "revealed position" after the character's left being visible despite not being in a line of sight any more.
This commit is contained in:
parent
14997bc1a3
commit
5c5aa14a3d
5 changed files with 49 additions and 26 deletions
|
|
@ -90,10 +90,13 @@ newtype GormlakBrain = GormlakBrain Creature
|
|||
|
||||
instance Brain GormlakBrain where
|
||||
step ticks = fmap coerce . stepGormlak ticks . coerce
|
||||
entityCanMove = const True
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
instance Brain Creature where step = brainVia GormlakBrain
|
||||
instance Brain Creature where
|
||||
step = brainVia GormlakBrain
|
||||
entityCanMove = const True
|
||||
|
||||
instance Entity Creature where
|
||||
blocksVision _ = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue