From e2d3a1a8d6d592e70c056ba02a3437c4516b79be Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Sat, 13 Oct 2018 02:02:57 +0100 Subject: [PATCH] Render Z levels slightly more accurately --- cmd/view-map/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/view-map/main.go b/cmd/view-map/main.go index 8db91cb..11619a3 100644 --- a/cmd/view-map/main.go +++ b/cmd/view-map/main.go @@ -222,10 +222,11 @@ func (s *state) renderCell(x, y, z int, target pixel.Target) { // Taking the Z index away *seems* to draw the object in the correct place. // FIXME: There are some artifacts, investigate more - fX := float64(x - z) - fY := float64(y - z) + fX := float64(x) + fY := float64(y) iso := s.cellToPix(pixel.V(fX, fY)) + iso = iso.Add(pixel.Vec{0.0, -float64(z * 48.0)}) for _, sprite := range sprites { sprite.Spr.Draw(target, pixel.IM.Moved(iso))