I am following the tutorial here on how to develop a rogue-like game using Python and I ran across this method call
if self.game_map.tiles["walkable"][self.player.x + action.dx, self.player.y + action.dy]:
I don't understand what is happening with the two sets of brackets at the end of the call. Is this an if statement format, or a specific way to call a method? The class containing this method is...
class GameMap:
def __init__(self, width: int, height: int):
self.width, self.height = width, height
self.tiles = np.full((width, height), fill_value=tile_types.floor, order="F")
self.tiles[30:33, 22] = tile_types.wall