Exemple #1
0
    def __init__(self, stdscr, w, h, filename = -1, maps = [3, 3],
                 mapPos = -1):
        self.maps = maps
        self.w = w
        self.h = h
        if mapPos == -1:
            self.mapPos = [maps[0]/2, maps[1]/2]
        else:
            self.mapPos = mapPos
        self.softPos = [self.mapPos[0] * 200, self.mapPos[1] * 200]
        
        self.textField = textfield.Textfield(2, 6, self.w/2 - 5, self.h - 7)
        self.persons = []
        self.cheatWalkEverywhere = False

        self.statusBox = statusbox.statusBox(stdscr, w, h)
        self.stdscr = stdscr



        if filename == -1:
            # If no filename is given, I will create an empty world
            self.walkArea = 3
            self.gMaps = []
            for i in range(maps[1]):
                self.gMaps.append([])
            for i in range(maps[0]):
                for j in range(maps[0]):
                    self.gMaps[j].append(gamemap.GameMap(self.w/2 + 2, 6,
                                                         self.w/2 - 5, self.h - 8))
                    self.gMaps[j][i].pos = [(self.mapPos[0] - j) * \
                                            self.gMaps[j][i].size[0],
                                            (self.mapPos[1] - i) * \
                                            self.gMaps[j][i].size[1]]
                    self.gMaps[j][i].textField = self.textField
Exemple #2
0
    def __init__(self, stdscr, w, h, filename):
        self.w = w
        self.h = h
        self.borderFunction(w, h)
        self.textField = textfield.Textfield(*self.screenposText())
        self.filename = filename
        self.maps = dict()
        self.globalMapPos = [0, 0]
        self.softPos = [0, 0]
        self.stdscr = stdscr

        self.WALK_AREA = 3

        self.onStepDict = dict()
        self.onFrameDict = dict()

        self.load()
        self.statusBox = statusbox.statusBox(stdscr, w, h, self.border)
        self.setMapPos((0, 0))
        self.redrawAllMaps()

	self.evalObjs = dict()

        textout.btText.trans['Messages:'] = {'de': 'Meldungen:'}
        textout.btText.trans['Map:'] = {'de': 'Karte:'}
        textout.btText.trans['State:'] = {'de': 'Status:'}

        # Menu translations
        textout.btText.trans['Continue'] = {'de': 'Weiterspielen'}
        textout.btText.trans['Quit'] = {'de': 'Beenden'}