Example #1
0
    public GameObject GetDoor(DoorPos d)
    {
        switch (d)
        {
        case DoorPos.top:
            return(topDoor);

        case DoorPos.bot:
            return(botDoor);

        case DoorPos.left:
            return(leftDoor);

        case DoorPos.right:
            return(rightDoor);
        }
        return(floor);
    }
Example #2
0
        public static Vector2 CalculateDoorCenter(Vector3 roomLoc, DoorPos position)
        {
            Vector2 pos = ConvertVector(roomLoc);

            switch (position)
            {
            case DoorPos.TOP:
                pos += new Vector2(ROOM_WIDTH / 2, WALL_SIZE / 2);
                break;

            case DoorPos.BOTTOM:
                pos += new Vector2(ROOM_WIDTH / 2, ROOM_HEIGHT - WALL_SIZE / 2);
                break;

            case DoorPos.LEFT:
                pos += new Vector2(WALL_SIZE / 2, ROOM_HEIGHT / 2);
                break;

            case DoorPos.RIGHT:
                pos += new Vector2(ROOM_WIDTH - WALL_SIZE / 2, ROOM_HEIGHT / 2);
                break;
            }
            return(pos);
        }
Example #3
0
 //A connection with
 public ConnectionInfo(int leftX, int leftY, int rightX, int rightY, DoorPos doorPos)
 {
     LeftX = leftX;
     LeftY = leftY;
     RightX = rightX;
     RightY = rightY;
     HasDoor = true;
     DoorPosition = doorPos;
 }