def data_process(self, line, y): for x in range(len(line)): if line[x] == rep["player"]: self.player = Player(x=x, y=y) if line[x] == rep["door"]: self.doors.append(Door(x=x, y=y)) if line[x] == rep["box"]: self.boxes.append(Box(x=x, y=y)) if line[x] == rep["wall"]: self.walls.append(Wall(x=x, y=y)) if line[x] == rep["ground"]: self.grounds.append(Ground(x=x, y=y))
def setBox(x, y): boxes.append(Box()) boxes[len(boxes) - 1].set_dimensions(50, 50) boxes[len(boxes) - 1].y_pos = y boxes[len(boxes) - 1].x_pos = x boxes[len(boxes) - 1].set_position(x, y)