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.7 KiB

6 years ago
  1. ----- INTRODUCTION [1.1] ---------------------------------------------------
  2. --[[ author@churchianity.ca
  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. ----- COORDINATE SYSTEMS [1.2] ----------------------------------------------
  8. * as much coordinate manipulation as possible is done internally.
  9. depending on the task, uses either Axial, Cube, or Doubled coordinates.
  10. * three different ways of returning and sending coordinates:
  11. 1) amulet vectors
  12. 2) lua tables
  13. 3) individual coordinate numbers
  14. so you can use what your graphics library likes best!
  15. ----- MAPS & MAP STORAGE [1.3] -------------------------------------------------
  16. some map shapes: parallelogram, rectangular, hexagonal, triangular. (and more)
  17. * storage system based on map shape - see chart:
  18. ________________________________________________________________________
  19. | SHAPE : MAP STORAGE |
  20. |------------------------------------------------------------------------|
  21. | parallelogram : unordered, hash-like OR ordered, array-like |
  22. | rectangular : unordered, hash-like OR ordered, array-like |
  23. | hexagonal : unordered, hash-like OR ordered, array-like |
  24. | triangular : unordered, hash-like OR ordered, array-like |
  25. | ring : ordered, array-like |
  26. | spiral : ordered, array-like** |
  27. | arbitrary : unordered, hash-like |
  28. |________________________________________________________________________|
  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. * https://catlikecoding.com/unity/tutorials/hex-map/
  34. -> unity tutorial for hexagon grids with some useful generalized math.
  35. * https://youtube.com/watch?v=fNk_zzaMoSs&list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab
  36. -> amazing series on linear algebra by 3Blue1Brown
  37. * https://redblobgames.com/grid/hexagons
  38. -> now THE resource on hexagonal grids on the internet.
  39. * http://amulet.xyz/doc
  40. -> amulet documentation.
  41. ]]