Render Z levels slightly more accurately

This commit is contained in:
2018-10-13 02:02:57 +01:00
parent 197b5e696b
commit e2d3a1a8d6

View File

@@ -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))