Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Set up tiles like this: (inside corners to the right)
- ┌─── ──── ───┐
- │ │ ┌ ┐
- │ │ └ ┘
- │ │
- │ │
- └─── ──── ───┘
- x = 1
- y = 1
- //check left/right
- if(left is open) x = 0
- else if(right is open) x = 2
- //check up/down
- if(up is open) y = 0
- else if(down is open) y = 2
- //special case for inside corners
- if (x == 1 && y == 1){
- if(top left is open){x = 4; y = 1}
- else if(top right is open){x = 3; y = 1}
- else if(bottom left is open){x = 4; y = 0}
- else if(bottom right is open){x = 3; y = 0}
- }
- use the tile at position x,y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement