Make animations work in the options screen

This commit is contained in:
2020-03-23 00:33:29 +00:00
parent c67ee206cd
commit bcee07e8f7
11 changed files with 172 additions and 86 deletions

15
internal/ui/animation.go Normal file
View File

@@ -0,0 +1,15 @@
package ui
import (
"github.com/hajimehoshi/ebiten"
)
type animation []*ebiten.Image
func (a animation) image(step int) *ebiten.Image {
if len(a) == 0 {
return nil
}
return a[step%len(a)]
}