Added a rain layer for atmosphere.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user