docs: Update

This commit is contained in:
Hajime Hoshi 2018-03-12 03:20:58 +09:00
parent a36ea971b4
commit 6213ee66f7
2 changed files with 3 additions and 3 deletions

View File

@ -210,12 +210,12 @@ 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.5, 0.01] // z is in [1, -1]
rate := float64(j) / float64(ph) rate := float64(j) / float64(ph)
z := (1-rate)*1.5 + rate*0.01 z := (1-rate)*1 + rate*-1
op := &ebiten.DrawImageOptions{} op := &ebiten.DrawImageOptions{}
op.GeoM.Translate(-float64(pw)/2, 0) op.GeoM.Translate(-float64(pw)/2, 0)
op.GeoM.Scale(1/z, 4) // 4 is an arbitrary number not to make empty lines. op.GeoM.Scale(1/z, 8) // 8 is an arbitrary number not to make empty lines.
op.GeoM.Translate(float64(pw)/2, float64(j)/z) op.GeoM.Translate(float64(pw)/2, float64(j)/z)
src := image.Rect(0, j, gw, j+1) src := image.Rect(0, j, gw, j+1)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 24 KiB