Make the game start
This commit is contained in:
@ -1,17 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
import curses
|
||||
|
||||
from dungeonbattle.display.texturepack import TexturePack
|
||||
from dungeonbattle.interfaces import Map
|
||||
from .texturepack import TexturePack
|
||||
|
||||
|
||||
class MapDisplay:
|
||||
|
||||
def __init__(self, m: Map, pack: TexturePack, height: int, width: int):
|
||||
def __init__(self, m: Map, pack: TexturePack, height: int, width: int,
|
||||
init_pad: bool = True):
|
||||
self.width = width
|
||||
self.height = height
|
||||
self.map = m
|
||||
self.pad = curses.newpad(m.height, m.width+1)
|
||||
self.pack = pack
|
||||
self.map = m
|
||||
if init_pad:
|
||||
self.pad = curses.newpad(m.height, m.width + 1)
|
||||
|
||||
def update_pad(self):
|
||||
self.pad.addstr(0, 0, self.map.draw_string(self.pack))
|
||||
@ -32,7 +35,3 @@ class MapDisplay:
|
||||
self.pad.clear()
|
||||
self.update_pad()
|
||||
self.pad.refresh(pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)
|
||||
|
||||
def refresh(self) :
|
||||
self.display(self.map.currenty,self.map.currentx)
|
||||
|
||||
|
Reference in New Issue
Block a user