From 1a39aeb912ac136b0d855e9f104525774e423647 Mon Sep 17 00:00:00 2001 From: Nicholas Hayashi Date: Mon, 22 Feb 2021 10:37:39 -0500 Subject: [PATCH] make grid smaller, hex size bigger --- src/grid.lua | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/grid.lua b/src/grid.lua index b025ddd..755c75d 100644 --- a/src/grid.lua +++ b/src/grid.lua @@ -6,25 +6,23 @@ do -- the size of the grid should basically always be constant (i think), -- but different aspect ratios complicate this in an annoying way - HEX_GRID_WIDTH = 41 + padding - HEX_GRID_HEIGHT = 27 + padding + HEX_GRID_WIDTH = 33 + padding + HEX_GRID_HEIGHT = 23 + padding HEX_GRID_DIMENSIONS = vec2(HEX_GRID_WIDTH, HEX_GRID_HEIGHT) HEX_GRID_CENTER = evenq_to_hex(vec2(math.floor(HEX_GRID_WIDTH/2) , -math.floor(HEX_GRID_HEIGHT/2))) -end --- pixel distance from hex centerpoint to any vertex --- given a grid width gx, and window width wx, what's the smallest size a hex can be to fill the whole screen? --- wx / (gx * 3 / 2) -HEX_SIZE = win.width / (41 * 3 / 2) + -- pixel distance from hex centerpoint to any vertex + -- given a grid width gx, and window width wx, what's the smallest size a hex can be to fill the whole screen? + -- wx / (gx * 3 / 2) + HEX_SIZE = win.width / ((HEX_GRID_WIDTH - padding) * 3 / 2) -HEX_PIXEL_WIDTH = hex_width(HEX_SIZE, HEX_ORIENTATION.FLAT) -HEX_PIXEL_HEIGHT = hex_height(HEX_SIZE, HEX_ORIENTATION.FLAT) -HEX_PIXEL_DIMENSIONS = vec2(HEX_PIXEL_WIDTH, HEX_PIXEL_HEIGHT) + HEX_PIXEL_WIDTH = hex_width(HEX_SIZE, HEX_ORIENTATION.FLAT) + HEX_PIXEL_HEIGHT = hex_height(HEX_SIZE, HEX_ORIENTATION.FLAT) + HEX_PIXEL_DIMENSIONS = vec2(HEX_PIXEL_WIDTH, HEX_PIXEL_HEIGHT) -do local hhs = hex_horizontal_spacing(HEX_SIZE) local hvs = hex_vertical_spacing(HEX_SIZE)