#๐Ÿ”’ I really need help.

4 messages ยท Page 1 of 1 (latest)

past blaze
#

I can't seem to figure out how to solve this issue with my programming. The physical new tile map will load, but the visuals of the old maze remains. I reaaly need help with this as I have a deadline to meet.
class Tile(simpleGE.Sprite):
def init(self, scene):
super().init(scene)
self.images = [
pygame.image.load("grass.png"),
pygame.image.load("dirt.png"),
pygame.image.load("stone.png")]

    self.stateName = ["grass", "dirt", "stone"]
    
    self.setSize(32, 32)
    self.GRASS = 0
    self.DIRT = 1
    self.stone = 2
    self.state = self.GRASS
    self.setState(self.state)
    self.scene.sprites.add(self)

def setState(self, state):
    self.state = state
    self.image = None
    self.copyImage(self.images[state])


def process(self):
    
    if self.clicked:
        for row in self.scene.tileset:
            for tile in row:
                newState = tile.state + 1
                if newState > 2:
                    newState = 0
                tile.setState(newState)
        
        
    
    if self.collidesWith(self.scene.player):
        stateInfo = self.stateName[self.state]
        self.scene.player.tileOver = self.tilePos
        self.scene.player.tileState = self.state
        rowCol = f"{self.tilePos[0]}, {self.tilePos[1]}"
        self.scene.lblOutput.text = f"{stateInfo} {rowCol}"
indigo stoneBOT
#

@past blaze

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.

indigo stoneBOT
#

@past blaze

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.