16 lines
200 B
Go
16 lines
200 B
Go
|
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)]
|
||
|
}
|