hexyz is tower defense game, and a lua library for dealing with hexagonal grids
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.2 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. # hex.lua
  2. ## INTRODUCTION [1.1]
  3. this is a library for using hexagonal grids in amulet/lua.
  4. it is extremely incomplete. the following list of features is
  5. either implemented shoddily, or not at all.
  6. if you want an actual good resource, go to [1.9].
  7. ## GETTING STARTED [1.2]
  8. //TODO
  9. ## COORDINATE SYSTEMS [1.3]
  10. as much coordinate manipulation as possible is done internally.
  11. depending on the task, uses either Axial, Cube, or Doubled coordinates.
  12. three different ways of returning and sending coordinates:
  13. * amulet vectors
  14. * lua tables
  15. * individual coordinate numbers
  16. so you can use what your graphics library likes best!
  17. ## MAPS & MAP STORAGE [1.4]
  18. Some map shapes: parallelogram, rectangular, hexagonal, triangular. (and more)
  19. * storage system based on map shape - see chart:
  20. | SHAPE | MAP STORAGE |
  21. | ----------------- | --------------------------------------------- |
  22. | parallelogram | unordered, hash-like OR ordered, array-like |
  23. | rectangular | unordered, hash-like OR ordered, array-like |
  24. | hexagonal | unordered, hash-like OR ordered, array-like |
  25. | triangular | unordered, hash-like OR ordered, array-like |
  26. | ring | ordered, array-like |
  27. | spiral | ordered, array-like** |
  28. | arbitrary | unordered, hash-like |
  29. ** note that a spiral map is just a hexagonal one with a particular order.
  30. ## CONVENTIONS AND TERMINOLOGY [1.8]
  31. because so many different kinds of coordinate pairs, trios
  32. ## RESOURCES USED TO DEVELOP THIS LIBRARY, AND FOR WHICH I AM GRATEFUL [1.9]
  33. * [Hex Map 1](https://catlikecoding.com/unity/tutorials/hex-map/) - unity tutorial for hexagon grids with some useful generalized math.
  34. * [3Blue1Brown - Essence of Linear Algebra](https://youtube.com/watch?v=fNk_zzaMoSs&list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab) - amazing series on linear algebra by 3Blue1Brown
  35. * [Hexagonal Grids](https://redblobgames.com/grid/hexagons) - THE resource on hexagonal grids on the internet.
  36. * [Amulet Docs](http://amulet.xyz/doc) - amulet documentation.