Node object:
class Node:
def __init__(self, location_x, location_y, terrain_type, battle_map):
self.location_x = location_x
self.location_y = location_y
self.terrain_type = terrain_type
self.battle_map = battle_map
Battle map object
class BattleMap:
def __init__(self, width, height):
self.width = width
self.height = height
self.nodes = np.zeros((width, height), dtype=object)
self.combatants = {"Charmander": (15, 15)}
self.initialize_nodes()
def initialize_nodes(self):
for x in range(self.width):
for y in range(self.height):
self.nodes[x, y] = Node(x, y, "default", self)
def get_node(self, x, y):
return self.nodes[x, y]
Creating the battle _map and canvas
b_map = BattleMap(30, 30)
canvas = Image.new("RGBA", ((b_map.width * 16) + 1, (b_map.height * 16) + 1), (0, 0, 0, 255))
.