20 lines
317 B
Go
20 lines
317 B
Go
package components
|
|
|
|
import "github.com/hajimehoshi/ebiten/v2"
|
|
|
|
type Player struct {
|
|
IsPrimary bool
|
|
Sprites []*ebiten.Image
|
|
LoopPos *Position
|
|
LoopStart bool
|
|
LoopCount int
|
|
}
|
|
|
|
func (player *Player) SwitchSprite() *ebiten.Image {
|
|
if player.IsPrimary {
|
|
return player.Sprites[0]
|
|
}
|
|
|
|
return player.Sprites[1]
|
|
}
|