-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrender_order.py
28 lines (22 loc) · 1.11 KB
/
render_order.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'''
'RenderOrder' class is used to tell the console when to draw things to important elements aren't hidden underneath others.
- 'enum': a set of named values that won't change. Good for static assets and properties.
- "auto': assigns incrementing integer values automatically. No need to retype if adding more later.
'''
from enum import (auto, Enum)
class RenderOrder(Enum):
'''
Sets the order in which certain entities are rendered/drawn to the console. (aka, the "Z-index").
- Lower values are rendered first, higher values rendered after.
- If two things are on the same tile, whatever gets rendered last is what the player will see.
'''
# Primary entities
CORPSE = auto() # Set when an entitiy dies
ITEM = auto() # Dropped Gold, etc.
ACTOR = auto() # Includes Player
# Merchants, shopkeepers, etc.
NPC = auto()
# 'holes' in the floor should swallow up entities, so it will always appear on top.
PIT = auto()
# Flames set tiles to 'light'(2-tile radius) and replenish equipped lamp/torch items.
FIRE = auto()