From 678176d0478e269148b0729de1c579521ce7442b Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 5 Mar 2016 14:06:22 +0200 Subject: [PATCH] Orientate the doors --- koperkapel/loaders/levelloader.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/koperkapel/loaders/levelloader.py b/koperkapel/loaders/levelloader.py index 190319e..9bb85e4 100644 --- a/koperkapel/loaders/levelloader.py +++ b/koperkapel/loaders/levelloader.py @@ -46,8 +46,14 @@ class LevelLoader(ResourceLoader): # Create the doors first doors = [] for door in door_info['doors']: - # Sort out angle - new_door = Door(door[0], door[1], 0) + x, y = door + # is this the right check + if self._level.can_walk(x + 1, y, 'floor') and self._level.can_walk(x - 1, y, 'floor'): + # vertical door + angle = 90 + else: + angle = 0 + new_door = Door(x, y, angle) self._level.doors.append(new_door) # Add the keypads for keypad in door_info['keypads']: -- 2.34.1