Created
April 19, 2017 09:54
-
-
Save zeffii/48b8c7c761e43c4e74a5b4b754329ae5 to your computer and use it in GitHub Desktop.
2d grid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_location(i): | |
items_wide = 40 | |
offset_x = 5 | |
offset_y = 5 | |
x = offset_x * (i % items_wide) | |
y = offset_y * math.floor(i / items_wide) | |
return [x, y] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment