From 5728ebc309b4753c939d751c7fd489b108e5dc09 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Sun, 1 Mar 2026 21:52:49 +0100 Subject: fix: prevent entities from overlapping when arriving at the same cell Update UpdateMoveSystem to maintain the moveMap as entities move within a tick. When an entity snaps to a grid cell: - Block the new cell in the moveMap immediately - Unblock the old cell Before snapping, check if the target cell was already claimed by another entity earlier in the same tick. If so, repath instead of overlapping. --- go.mod | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'go.mod') diff --git a/go.mod b/go.mod index 2c62952..398b4b5 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ toolchain go1.24.4 require ( github.com/hajimehoshi/ebiten/v2 v2.8.8 github.com/martinlehoux/kagamigo v0.6.1 + github.com/stretchr/testify v1.11.1 golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b golang.org/x/image v0.28.0 ) @@ -14,6 +15,7 @@ require ( require ( github.com/BurntSushi/toml v1.5.0 // indirect github.com/a-h/templ v0.3.906 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/ebitengine/gomobile v0.0.0-20250329061421-6d0a8e981e4c // indirect github.com/ebitengine/hideconsole v1.0.0 // indirect github.com/ebitengine/purego v0.8.4 // indirect @@ -22,7 +24,7 @@ require ( github.com/jezek/xgb v1.1.1 // indirect github.com/kataras/i18n v0.0.8 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/stretchr/testify v1.11.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect golang.org/x/net v0.41.0 // indirect golang.org/x/sync v0.15.0 // indirect golang.org/x/sys v0.33.0 // indirect -- cgit v1.3