#๐Ÿ”’ loop out of range

13 messages ยท Page 1 of 1 (latest)

cedar briar
#
class Cam:
    def __init__(self, game_map, ):
        self.game_map = game_map["game_map"]
        self.player = Player()
        self.view_port = [[[]]]
        self.view_size = [5,5]
        self.view_position = [0,0]
        
    def update_view_port(self):
        for x in range(self.view_size[0]):
            for y in range(self.view_size[1]):
                for z in range(len(self.game_map[x][y])):
                    self.view_port[x][y].append(self.game_map[x][y][z])
        pprint(self.view_port)
    
    def move_view_port(self, ):
        pass
        
        
    

    def move_player (self):
        pass

    def p(self):
        pprint(self.view_port)







data = {"game_map":[
        [["grass",True,"player"],["grass",True,],["grass",True,],[None],[None],[None],[None],[None],[None],[None],],
        [["grass",True,],["grass",True,],["grass",True,],[None],[None],[None],[None],[None],[None],[None],],
        [["grass",True,],["grass",True,],["grass",True,],[None],[None],[None],[None],[None],[None],[None],],
        [[None],[None],[None],[None],[None],[None],[None],[None],[None],[None],],
        [[None],[None],[None],[None],[None],[None],[None],[None],[None],[None],],
        [[None],[None],[None],[None],[None],[None],[None],[None],[None],[None],],
        [[None],[None],[None],[None],[None],[None],[None],[None],[None],[None],],
        [[None],[None],[None],[None],[None],[None],[None],[None],[None],[None],],
        [[None],[None],[None],[None],[None],[None],[None],[None],[None],[None],],]
}

if __name__ == "__main__":
    c = Cam(data)
    c.update_view_port()
    c.p()
sudden viperBOT
#

@cedar briar

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.

cedar briar
#

update_view_port is broke i dont know how to fix

sterile hamlet
#

!close

buoyant turtle
#

!traceback
@cedar briar

sudden viperBOT
#
Traceback

Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.

A full traceback could look like:

Traceback (most recent call last):
  File "my_file.py", line 5, in <module>
    add_three("6")
  File "my_file.py", line 2, in add_three
    a = num + 3
        ~~~~^~~
TypeError: can only concatenate str (not "int") to str

If the traceback is long, use our pastebin.

cedar briar
#

??

#

I thought I closed this

buoyant turtle
#

Your alter tried, but they are not you.

cedar briar
#

! close

#

!close

sudden viperBOT
#
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.