From: Neil Date: Sat, 5 Mar 2016 12:06:22 +0000 (+0200) Subject: Orientate the doors X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=678176d0478e269148b0729de1c579521ce7442b;p=koperkapel.git Orientate the doors --- 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']: