Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def resetGrid(display_player):
- canvas.delete("all")
- if display_player:
- colourMatrix[player_y][player_x] = COLOUR_PLAYER
- rows, cols = len(colourMatrix), len(colourMatrix[0])
- rect_width = canvas_width // cols
- rect_height = canvas_height // cols
- for y, row in enumerate(colourMatrix):
- for x, colour in enumerate(row):
- x0, y0 = x * rect_width, y * rect_height
- x1, y1 = x0 + rect_width-1, y0 + rect_height-1
- #Still deciding on whether to use colours or text
- canvas.create_rectangle(x0, y0, x1, y1, fill=colour, width=0, outline=colour)
- #canvas.create_text(((x0+x1)/2), ((y0+y1)/2), fill=colour, font="Times 50", text = "@")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement