-
Notifications
You must be signed in to change notification settings - Fork 39
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
How should sector's be created on the server? #73
Comments
You probably don't need IDs, since the x and y coordinates of a sector should identify it. |
Would I need the x and y of 2 point's or just 1? I'm thinking 2 because that would be the only way to identify whether the player is inside the sector |
All sectors have the same width and height, so one coordinate would be enough. |
How should I go about creating the sector's? Should I add |
for (y = 0; y < sector_count_along_edge; y++) {
for (x = 0; x < sector_count_along_edge; x++) {
createSector(x, y);
}
} In |
Ok, thank's! I'll try implement something like that |
Ok, so I've used your code to make the sector's and store them in an array but I'm not sure how to check which sector the snake is inside. Sorry for taking so long to reply. I had problems with my internet for a while |
You're using a two-dimensional array I guess? |
No, I'm using a one-dimensional array of |
Use a two dimensional array. That way you can just get the sector with |
I'm not sure I understand. So should each sector have just |
Let's say you have If you need |
Ok, now I get you. Thanks I'll try implement it that way then |
Any updates? |
I'm finding it hard to update this project this year. I'm currently in junior cert (exam year) so need to spend some time studying and homework |
How should I go about creating the sector's for my slither server? Should I create them all at once and if so, do each of them need ID's?
The text was updated successfully, but these errors were encountered: