def __init__(self, id, width, top_margin, left_margin, height): self.left_margin = left_margin self.top_margin = top_margin self.height = height self.width = width self.id = id self.left = utils.new_matrix(left_margin, height, -1) self.top = utils.new_matrix(width, top_margin, -1)
def __init__(self, level): self.level = level # position of the cursor (y, x) self.cursor_pos = (0, 0) self.allow_help = True self.master = None self.daemon = True self.win = None self.out = "" # dimensions. self.total_height = 0 self.total_width = 0 # count the distance utility. self.count_distance = False # (y, x), only take in account the biggest one. self.count_origin = (0, 0) # matrix for the marks on the puzzle. self.marks = utils.new_matrix(level.width, level.height, self.NULL)