mini_map = [
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 1, _, 1, 1, _, _, _, _, _, 1, 1, _, _, _, 1],
[1, _, _, _, _, 1, 1, _, _, _, 1, 1, 1, _, _, _, 1, 1, _, _, _, _, _, 1, 1, 1, _, _, 1, 1, _, 1],
[1, _, _, _, _, _, 1, _, _, _, _, _, 1, _, _, _, _, _, 1, 1, 1, _, _, _, _, _, 1, _, _, _, _, 1],
[1, _, 1, _, _, _, _, _, _, _, 1, 1, _, _, _, 1, 1, 1, 1, _, _, _, _, _, 1, 1, _, _, 1, 1, _, 1],
[1, _, _, 1, 1, _, _, _, 1, 1, _, _, _, 1, 1, _, _, _, 1, _, 1, _, 1, _, 1, 1, 1, _, _, 1, _, 1],
[1, _, _, _, 1, _, _, _, 1, _, _, _, 1, _, _, _, 1, _, _, _, 1, _, _, _, 1, _, _, _, 1, _, _, 1],
[1, _, 1, 1, 1, _, _, _, _, 1, 1, 1, _, _, _, _, _, 1, _, _, _, 1, _, _, _, _, 1, _, _, _, _, 1],
[1, _, _, _, _, _, _, _, _, _, 1, 1, 1, _, _, 1, 1, _, _, _, _, _, _, _, _, 1, _, _, _, 1, _, 1],
[1, _, _, _, _, _, _, 1, 1, _, _, _, 1, _, _, 1, _, _, _, _, _, 1, 1, _, _, _, _, 1, _, _, _, 1],
[1, _, _, _, 1, 1, _, _, 1, _, _, _, 1, 1, _, _, _, _, _, 1, 1, _, _, 1, 1, _, _, 1, _, _, _, 1],
[1, _, _, 1, _, _, _, 1, 1, _, _, _, _, _, _, 1, 1, 1, 1, 1, _, _, _, _, _, _, 1, _, 1, _, _, 1],
[1, _, _, _, _, _, 1, _, _, _, _, _, 1, _, _, _, _, 1, _, _, _, _, 1, _, _, _, _, 1, _, _, _, 1],
[1, _, 1, _, _, _, _, _, _, _, 1, 1, _, _, _, 1, _, _, _, _, _, _, _, _, 1, _, _, 1, _, _, _, 1],
[1, _, _, 1, 1, _, _, _, 1, 1, _, _, _, 1, 1, _, _, 1, 1, _, _, _, _, _, _, 1, 1, _, _, _, _, 1],
[1, _, _, _, 1, _, _, _, 1, _, _, _, 1, _, _, _, 1, _, _, _, 1, _, _, _, 1, _, _, _, 1, _, _, 1],
[1, _, _, _, _, _, _, _, 1, 1, _, _, _, 1, 1, 1, _, _, _, 1, 1, _, 1, _, _, _, 1, _, _, _, _, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
]
def check_wall(self, x, y):
return (x, y) not in self.game.map.world_map
def check_wall_collision(self, dx, dy: object):
if self.check_wall(int(self.x + dx), int(self.y)):
self.x += dx
if self.check_wall(int(self.x), int(self.y + dy)):
self.y += dy
Need the collision system to work with a 32 X 18 mini-map but i am starting to think it's just not compatible. I am trying to make a 3D style game with python utilizing what i've learned thus far as i am new to python, started in june this year. Already worked on a basic project but using raycasting to create a 3D style game in python and it's on a whole other level but definitely fun. I also think the problem might be update related as i am running pygame 2.1.2 and python 3.10.7 and certain syntax's have been altered in one way or another.