2024-02-22 19:40:49 +01:00
|
|
|
package components
|
|
|
|
|
|
|
|
|
|
import "github.com/hajimehoshi/ebiten/v2"
|
|
|
|
|
|
|
|
|
|
type Player struct {
|
|
|
|
|
IsPrimary bool
|
|
|
|
|
Sprites []*ebiten.Image
|
2024-02-27 18:20:00 +01:00
|
|
|
LoopPos *Position
|
|
|
|
|
LoopStart bool
|
|
|
|
|
LoopCount int
|
2024-02-22 19:40:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (player *Player) SwitchSprite() *ebiten.Image {
|
|
|
|
|
if player.IsPrimary {
|
|
|
|
|
return player.Sprites[0]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return player.Sprites[1]
|
|
|
|
|
}
|