19 lines
471 B
Python
19 lines
471 B
Python
"""Base entity: a thing with a position on the map."""
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass(slots=True)
|
|
class Entity:
|
|
"""Anything that lives on a dungeon tile: player, enemies, items, stairs.
|
|
|
|
`sprite_key` names the procedural pixel-art sprite to rasterize for it.
|
|
`blocks` is True when other entities cannot share its tile.
|
|
"""
|
|
x: int
|
|
y: int
|
|
name: str
|
|
sprite_key: str
|
|
blocks: bool = True
|