squirrel-battle/dungeonbattle/display/display.py

22 lines
672 B
Python
Raw Normal View History

2020-11-06 14:34:24 +00:00
import curses
from .mapdisplay import MapDisplay
2020-11-06 16:43:30 +00:00
from .texturepack import TexturePack
2020-11-06 14:34:24 +00:00
class Display:
def __init__(self, game, screen):
self.screen = screen
self.game = game
2020-11-06 19:28:10 +00:00
lines = curses.LINES if screen else 4
cols = curses.COLS * 4 // 5 if screen else 4
2020-11-06 19:24:19 +00:00
self.map_display = MapDisplay(game.m,
TexturePack.get_pack(
2020-11-06 16:43:30 +00:00
game.settings.TEXTURE_PACK),
2020-11-06 19:28:10 +00:00
lines, cols, screen is not None)
2020-11-06 16:43:30 +00:00
2020-11-06 14:34:24 +00:00
def refresh(self):
2020-11-06 19:24:19 +00:00
self.map_display.update_pad()
def display(self, y, x):
self.map_display.display(y, x)