level = [ [' ', ' ', '#', '#', '#'], [' ', ' ', '#', '.', '#'], [' ', ' ', '#', ' ', '#', '#', '#', '#'], ['#', '#', '#', '$', ' ', '$', '.', '#'], ['#', '.', ' ', '$', '@', '#', '#', '#'], ['#', '#', '#', '#', '$', '#'], [' ', ' ', ' ', '#', '.', '#'], [' ', ' ', ' ', '#', '#', '#'], ] player = '@' player_on_storage = '+' box = '$' box_on_storage = '*' storage = '.' wall = '#' empty = ' ' def draw(): screen.fill((255, 255, 190)) for y, row in enumerate(level): for x, cell in enumerate(row): if cell != empty: cell_size = 23 colors = { player: (167, 135, 255), player_on_storage: (158, 119, 255), box: (255, 201, 126), box_on_storage: (150, 255, 127), storage: (156, 229, 255), wall: (255, 147, 209), } screen.draw.filled_rect( Rect( (x * cell_size, y * cell_size), (cell_size, cell_size) ), color=colors[cell] ) screen.draw.text( cell, (x * cell_size, y * cell_size), color=(255, 255, 255) )