examples/airship: Improve z values

This commit is contained in:
Hajime Hoshi 2018-03-15 01:17:07 +09:00
parent 2555e3f226
commit 5fc190013a

View File

@ -198,9 +198,9 @@ func drawGroundImage(screen *ebiten.Image, ground *ebiten.Image) {
gw, _ := ground.Size()
pw, ph := perspectiveGroundImage.Size()
for j := 0; j < ph; j++ {
// z is in [1, -1]
// z is in [2, -1]
rate := float64(j) / float64(ph)
z := (1-rate)*1 + rate*-1
z := (1-rate)*2 + rate*-1
if z <= 0 {
break
}