summaryrefslogtreecommitdiff
path: root/tileanim.go
diff options
context:
space:
mode:
authoranon5 <anon5clam@protonmail.com>2021-06-21 18:47:26 +0000
committeranon5 <anon5clam@protonmail.com>2021-06-21 18:47:26 +0000
commit425da65ed46061303604610bb539d6495b2b1f3f (patch)
tree10ae3e665132c369ce0207676321cef870679923 /tileanim.go
parent9f239d341ef46b656dda759020da87bdd0606344 (diff)
Add high-level protocol (de)serialization
Diffstat (limited to 'tileanim.go')
-rw-r--r--tileanim.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/tileanim.go b/tileanim.go
new file mode 100644
index 0000000..bc6d6dd
--- /dev/null
+++ b/tileanim.go
@@ -0,0 +1,27 @@
+package mt
+
+type AnimType uint8
+
+const (
+ NoAnim AnimType = iota
+ VerticalFrameAnim
+ SpritesheetAnim
+ maxAnim
+)
+
+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
+}