Hex board: corner starting zones, half tile spacing

Server - MakeHexagon starting zones:
- Zones are now corner-based instead of full-edge: each zone is the corner
  tile plus (N-1)/2 tiles along each of the two edges meeting at that corner
- 2 players → opposite corners (0, 3 = right/left); 3 → every-other corner
  (0,2,4); 4 → (0,1,3,4); 5 → (0-4); 6 → all 6 corners

Client - game_screen.gd:
- Add HEX_TILE_SPACING = TILE_SPACING * 0.5 constant
- _coord_to_world: use HEX_TILE_SPACING for hex world positions
- _add_tile: tile cylinder radius scaled by HEX_TILE_SPACING
- _add_highlight: highlight cylinder radius scaled by HEX_TILE_SPACING

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-04-01 18:44:20 -04:00
co-authored by Claude Happy
parent 97e7698000
commit f9832d1a1f
2 changed files with 48 additions and 36 deletions
@@ -1101,6 +1101,7 @@ func _touch_pair_mid() -> Vector2:
## Grid spacing: 1.0 tile + 0.1 gap between tiles (visual only).
const TILE_SPACING := 1.1
const HEX_TILE_RADIUS := 0.5774 # ≈ 1/√3 — flat-to-flat = TILE_SPACING
const HEX_TILE_SPACING := TILE_SPACING * 0.5 # hex boards use tighter spacing
var _board_grid_type : String = "Square"
var _board_hex_sides : int = 0
@@ -1110,8 +1111,8 @@ func _coord_to_world(x: int, y: int) -> Vector3:
var N : int = _board_hex_sides
var q : float = x - (N - 1)
var r : float = y - (N - 1)
var wx : float = TILE_SPACING * sqrt(3.0) * (q + r * 0.5)
var wz : float = TILE_SPACING * 1.5 * r
var wx : float = HEX_TILE_SPACING * sqrt(3.0) * (q + r * 0.5)
var wz : float = HEX_TILE_SPACING * 1.5 * r
return Vector3(wx, 0.0, wz)
return Vector3(
x * TILE_SPACING - (Game.board_width() - 1) * TILE_SPACING * 0.5, 0.0,
@@ -1220,12 +1221,12 @@ func _add_tile(x: int, y: int, affinity: String) -> void:
if _board_grid_type == "Hexagon":
var cyl := CylinderMesh.new()
cyl.radial_segments = 6
cyl.top_radius = HEX_TILE_RADIUS * TILE_SPACING
cyl.bottom_radius = HEX_TILE_RADIUS * TILE_SPACING
cyl.top_radius = HEX_TILE_RADIUS * HEX_TILE_SPACING
cyl.bottom_radius = HEX_TILE_RADIUS * HEX_TILE_SPACING
cyl.height = h
mi.mesh = cyl
var cshape := CylinderShape3D.new()
cshape.radius = HEX_TILE_RADIUS * TILE_SPACING
cshape.radius = HEX_TILE_RADIUS * HEX_TILE_SPACING
cshape.height = h
shape.shape = cshape
else:
@@ -2366,8 +2367,8 @@ func _add_highlight(x: int, y: int, type_key: String) -> void:
if _board_grid_type == "Hexagon":
var hm := CylinderMesh.new()
hm.radial_segments = 6
hm.top_radius = HEX_TILE_RADIUS * TILE_SPACING * 0.95
hm.bottom_radius = HEX_TILE_RADIUS * TILE_SPACING * 0.95
hm.top_radius = HEX_TILE_RADIUS * HEX_TILE_SPACING * 0.95
hm.bottom_radius = HEX_TILE_RADIUS * HEX_TILE_SPACING * 0.95
hm.height = 0.02
mi.mesh = hm
else: