#๐Ÿ”’ Help?

5 messages ยท Page 1 of 1 (latest)

steady hamlet
#

I've tried a lot of techniques, but every time I try to transition from one maze section to another, the physical map of the next maze loads, but the design of the previous one hides it. Does anyone have any recommendations on how to move forward or fix it?
class Game(simpleGE.Scene):
TILE_SIZE = 32
PLAYER_START_X = 320
PLAYER_START_Y = 224

def init(self):
    super().init()
    self.setCaption("Click on a tile to edit, arrows to move")
    self.tileset = []
    self.ROWS = 15
    self.COLS = 20


    self.player = Player(self)
    self.lblOutput = LblOutput()
    self.player.x = self.PLAYER_START_X
    self.player.y = self.PLAYER_START_Y
    self.sprites = [self.tileset, self.player, self.lblOutput]
     # Ensure the first maze is maze_starting.csv
    self.mazes = [
        self.create_maze_starting(),
        self.create_maze_2(),
        self.create_maze_3(),
        self.create_maze_4(), 
        self.create_maze_5(),
        self.create_maze_6(),
    ]
    self.current_maze = self.set_maze(first=True)
    self.loadMap(self.mazes[self.current_maze])

def loadRandomMaze(self):
    while True:
        randomMaze = random.randrange(1, len(self.mazes))
        if randomMaze != self.current_maze:
            self.current_maze = randomMaze
            self.clearTileset()
            self.loadMap(self.mazes[self.current_maze])
            self.player.reset_position()
            break
def clearTileset(self):
    for row in self.tileset:
        for tile in row:
            del tile
    self.screen.fill((0, 0, 0))
    self.tileset = []
    self.sprites = []
    pygame.display.flip()
def set_maze(self, first=False):
    if first:
        return 0
    else:
        self.loadRandomMaze()
mystic sleetBOT
#

@steady hamlet

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

steady hamlet
#

If there's any information that is needed, I can provide it.

mystic sleetBOT
#

@steady hamlet

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.