From b99a4076b8874b33b0a3fcaf6339051b259ba2e8 Mon Sep 17 00:00:00 2001 From: Cameron Reikes Date: Tue, 25 Oct 2022 16:42:06 -0700 Subject: [PATCH] Fix snap dist --- main.c | 2 +- types.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 0429fa0..918e963 100644 --- a/main.c +++ b/main.c @@ -262,7 +262,7 @@ static void frame(void) hand_pos = V2scale(V2normalize(hand_pos), hand_len); hand_pos = V2add(hand_pos, gs.players[myplayer].pos); - struct Grid *placing_grid = closest_to_point_in_radius(&gs, hand_pos, 0.35f); + struct Grid *placing_grid = closest_to_point_in_radius(&gs, hand_pos, BUILD_BOX_SNAP_DIST_TO_SHIP); if (placing_grid == NULL) { build_preview = (struct BuildPreviewInfo){ diff --git a/types.h b/types.h index 3659f44..47a427f 100644 --- a/types.h +++ b/types.h @@ -1,10 +1,11 @@ #pragma once #define MAX_PLAYERS 4 -#define BOX_SIZE 0.5f +#define BOX_SIZE 0.25f #define MAX_HAND_REACH 1.0f #define GOLD_COLLECT_RADIUS 0.3f #define MAX_GRIDS 32 +#define BUILD_BOX_SNAP_DIST_TO_SHIP 0.2f #define MAX_BOXES_PER_GRID 32 #define BOX_MASS 1.0f #define TIMESTEP (1.0f / 60.0f) // not required to simulate at this, but this defines what tick the game is on