From d0916d568a00f5171b96fbc3bfc19ff263affc27 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 27 Jan 2023 13:43:49 +0000 Subject: coords, hexagons, drawing, chunks --- common/chunk.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 common/chunk.lua (limited to 'common/chunk.lua') diff --git a/common/chunk.lua b/common/chunk.lua new file mode 100644 index 0000000..38cdaf0 --- /dev/null +++ b/common/chunk.lua @@ -0,0 +1,30 @@ +local CHUNK_SIZE = 128 + +-- for now tiles shall be booleans + +local function index(offq,offr) + -- indexes start at 0 + -- and go up to (CHUNK_SIZE^2)-1 + assert(0<=offq and 0<=offr and offq