mirror of
https://github.com/n0remac/game-jam-2020.git
synced 2025-12-15 18:10:00 -06:00
create dungeon matrix for pathfinding
This commit is contained in:
@@ -7,6 +7,8 @@ Pathfinding will also depend on objects here, and is thus integral to it's funct
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
import arcade
|
import arcade
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
@@ -40,6 +42,14 @@ class Dungeon(object):
|
|||||||
self.levels = [
|
self.levels = [
|
||||||
[Level.load_file(x, y, center) for y in range(size)] for x in range(size)
|
[Level.load_file(x, y, center) for y in range(size)] for x in range(size)
|
||||||
]
|
]
|
||||||
|
self.matrix = [[0 for yy in range(size * 10)] for xx in range(10 * size)]
|
||||||
|
for column in self.levels:
|
||||||
|
for level in column:
|
||||||
|
for xx in range(10):
|
||||||
|
for yy in range(10):
|
||||||
|
if level.structure[xx][yy] == 'w':
|
||||||
|
self.matrix[(level.x * 10) + xx][(level.y * 10) + yy] = 1
|
||||||
|
# pprint(self.matrix, width=1000)
|
||||||
|
|
||||||
def getWalls(self) -> arcade.SpriteList:
|
def getWalls(self) -> arcade.SpriteList:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user