Add draw priority

Rather than blindly taking one entity from the list when we have
multiple entities on the same tile, add a `drawPriority` method to the
Draw typeclass which allows individual entities to request to be drawn
on top - this avoids the "noodles floating over your head" bug we saw
before.
This commit is contained in:
Griffin Smith 2019-10-16 12:10:59 -04:00
parent 4882350f5d
commit 87fedcb6c9
5 changed files with 30 additions and 6 deletions

View file

@ -50,6 +50,7 @@ instance Draw Character where
where
rloc = Location (negate scrollOffset, negate scrollOffset)
rreg = (2 * scrollOffset, 2 * scrollOffset)
drawPriority = const maxBound -- Character should always be on top, for now
-- the character does not (yet) have a mind of its own
instance Brain Character where step = brainVia Brainless