Added a rain layer for atmosphere.

This commit is contained in:
2024-11-23 01:13:55 -05:00
parent 253c708d45
commit 63eafe036a
9 changed files with 284 additions and 1 deletions

View File

@@ -77,6 +77,26 @@ func (sp *Splash) Draw() {
sp.Sprite.DrawImage(assets.ImageBank[assets.Splash], op)
}
for i := 0; i < 5; i++ {
percent := float64(5-i) / 5
a := 9.8
time := float64(sp.cycle) / 8
v0 := 10.
dy := 1/2.*a*math.Pow(time-float64(i), 2) - v0*time
dx := -float64(sp.cycle)
op := &ebiten.DrawImageOptions{}
op.GeoM.Translate(-48/2, -48/2)
op.GeoM.Scale(percent, percent)
op.GeoM.Rotate(-float64(sp.cycle) / (math.Pi * 4))
op.GeoM.Translate(SPLASH_DIM/2, SPLASH_DIM/2)
op.GeoM.Translate(dx, dy)
sp.Sprite.DrawImage(assets.ImageBank[assets.Splash], op)
op.GeoM.Translate(-2*dx, 0)
sp.Sprite.DrawImage(assets.ImageBank[assets.Splash], op)
}
}
func (sp *Splash) GetPosition() gamedata.Coordinates {