Add a map with tiles that can block player movement
This commit is contained in:
parent
4419eb360d
commit
367b284d31
4 changed files with 62 additions and 9 deletions
19
roguebasin/tile.py
Normal file
19
roguebasin/tile.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env python3
|
||||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
import tcod
|
||||
from typing import Optional
|
||||
|
||||
class Tile:
|
||||
class Color:
|
||||
WALL = tcod.Color(255, 255, 255)
|
||||
GROUND = tcod.Color(33, 33, 33)
|
||||
|
||||
def __init__(self, blocks_movement: bool, blocks_sight: Optional[bool] = None):
|
||||
self.blocks_movement = blocks_movement
|
||||
|
||||
# If blocks_sight isn't explicitly given, tiles that block movement also block sight.
|
||||
if blocks_sight is None:
|
||||
self.blocks_sight = blocks_movement
|
||||
else:
|
||||
self.blocks_sight = blocks_sight
|
||||
Loading…
Add table
Add a link
Reference in a new issue