summaryrefslogtreecommitdiff
path: root/tileanim.go
blob: 339f15ee939a0ebff9d7b97e822a30e7bc8e0b7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package mt

type AnimType uint8

const (
	NoAnim            AnimType = iota // none
	VerticalFrameAnim                 // vertical frame
	SpriteSheetAnim                   // sprite sheet
	maxAnim
)

//go:generate stringer -linecomment -type AnimType

type TileAnim struct {
	Type AnimType
	//mt:assert %s.Type < maxAnim

	//mt:if %s.Type == SpriteSheetAnim
	AspectRatio [2]uint8
	//mt:end

	//mt:if %s.Type == VerticalFrameAnim
	NFrames [2]uint16
	//mt:end

	//mt:if %s.Type != NoAnim
	Duration float32 // in seconds
	//mt:end
}