mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
examples/airship: Improve z values
This commit is contained in:
parent
2555e3f226
commit
5fc190013a
@ -198,9 +198,9 @@ func drawGroundImage(screen *ebiten.Image, ground *ebiten.Image) {
|
|||||||
gw, _ := ground.Size()
|
gw, _ := ground.Size()
|
||||||
pw, ph := perspectiveGroundImage.Size()
|
pw, ph := perspectiveGroundImage.Size()
|
||||||
for j := 0; j < ph; j++ {
|
for j := 0; j < ph; j++ {
|
||||||
// z is in [1, -1]
|
// z is in [2, -1]
|
||||||
rate := float64(j) / float64(ph)
|
rate := float64(j) / float64(ph)
|
||||||
z := (1-rate)*1 + rate*-1
|
z := (1-rate)*2 + rate*-1
|
||||||
if z <= 0 {
|
if z <= 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user