Render Z levels slightly more accurately
This commit is contained in:
@@ -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))
|
||||
|
Reference in New Issue
Block a user