Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some issues about the neighbor rule #95

Open
Alex-skiler opened this issue Oct 5, 2024 · 3 comments
Open

some issues about the neighbor rule #95

Alex-skiler opened this issue Oct 5, 2024 · 3 comments

Comments

@Alex-skiler
Copy link

when I write my neighbor part(in the sample.xml),I found i couldn't define upper or below neighbor rule. As an example, there is 'T',I want 'T' below neighbor a 'I'. How can i do it?

@mxgmn
Copy link
Owner

mxgmn commented Oct 6, 2024

Indeed, it is only possible to specify left and right neighbors in the xml file. But you still can specify arbitrary adjacencies, because you can rotate the tiles. For example,

<neighbor left="cliff 1" right="road 3"/>

means that the cliff tile rotated 1*90 degrees can be adjacent from the left to the road tile rotated 3*90 degrees. So it is possible to specify vertical adjacencies using tile rotations.

@Alex-skiler
Copy link
Author

I found these code seem to decide the "upper or below" rules
int L = action[firstOccurrence[left[0]]][left.Length == 1 ? 0 : int.Parse(left[1])], D = action[L][1];
int R = action[firstOccurrence[right[0]]][right.Length == 1 ? 0 : int.Parse(right[1])], U = action[R][1];
why the D and U directly use '1' as the second number in the action[][]?

@mxgmn
Copy link
Owner

mxgmn commented Oct 7, 2024

Because Down and Up correspond to Left and Right by rotating 1*90 degrees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants