]> Dogcows Code - chaz/yoink/commitdiff
converted json sequences to lua
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Mon, 2 Nov 2009 20:57:03 +0000 (13:57 -0700)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Mon, 2 Nov 2009 20:57:03 +0000 (13:57 -0700)
code hasn't change to use them though so it's broken for now

16 files changed:
data/animations/AlienWarrior.json [deleted file]
data/animations/AlienWarrior.lua [new file with mode: 0644]
data/animations/BigExplosion.json [deleted file]
data/animations/BigExplosion.lua [new file with mode: 0644]
data/animations/Bonuses.json [deleted file]
data/animations/Bonuses.lua [new file with mode: 0644]
data/animations/Bullets.json [deleted file]
data/animations/Bullets.lua [new file with mode: 0644]
data/animations/Effects.json [deleted file]
data/animations/Effects.lua [new file with mode: 0644]
data/animations/Heroine.json [deleted file]
data/animations/Heroine.lua [new file with mode: 0644]
data/animations/Jetbot.json [deleted file]
data/animations/Jetbot.lua [new file with mode: 0644]
data/animations/RobotTrooper.json [deleted file]
data/animations/RobotTrooper.lua [new file with mode: 0644]

diff --git a/data/animations/AlienWarrior.json b/data/animations/AlienWarrior.json
deleted file mode 100644 (file)
index 2268fca..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-{
-       "Stand":
-       {
-               "type": "Stand",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 0,
-                               "duration": 2
-                       },
-                       {
-                               "index": 1,
-                               "duration": 0.25
-                       },
-                       {
-                               "index": 2,
-                               "duration": 2
-                       },
-                       {
-                               "index": 1,
-                               "duration": 0.25
-                       }
-               ]
-       },
-       "Run":
-       {
-               "type": "Run",
-               "delay": 0.25,
-               "frames":
-               [
-                       {
-                               "index": 3
-                       },
-                       {
-                               "index": 4
-                       },
-                       {
-                               "index": 5
-                       },
-                       {
-                               "index": 6
-                       }
-               ]
-       },
-       "StopRunning":
-       {
-               "type": "Stand",
-               "next": "Stand",
-               "delay": 10,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 7
-                       }
-               ]
-       },
-       "Jump":
-       {
-               "type": "Jump",
-               "next": "FlyDiagonallyUp",
-               "delay": 0.25,
-               "frames":
-               [
-                       {
-                               "index": 17
-                       }
-               ]
-       },
-       "Land":
-       {
-               "type": "Stand",
-               "next": "Stand",
-               "delay": 1,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 13,
-                               "duration": 0.25
-                       }
-               ]
-       },
-       "FlyDiagonallyUp":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 18
-                       }
-               ]
-       },
-       "FlyDiagonallyDown":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 19
-                       }
-               ]
-       },
-       "FlyStraightUp":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 19
-                       }
-               ]
-       },
-       "FlyHorizontally":
-       {
-               "type": "Fly",
-               "frames":
-               [
-                       {
-                               "index": 3
-                       }
-               ]
-       },
-       "Punch":
-       {
-               "type": "Attack",
-               "delay": 0.2,
-               "frames":
-               [
-                       {
-                               "index": 8
-                       },
-                       {
-                               "index": 9
-                       }
-               ]
-       },
-       "StartFiring":
-       {
-               "type": "Attack",
-               "next": "Fire",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 0
-                       },
-                       {
-                               "index": 8
-                       }
-               ]
-       },
-       "Fire":
-       {
-               "type": "Attack",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 10,
-                               "duration": 0.2
-                       },
-                       {
-                               "index": 11,
-                               "duration": 0.2
-                       }
-               ]
-       },
-       "StopFiring":
-       {
-               "type": "Attack",
-               "next": "Stand",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 8
-                       },
-                       {
-                               "index": 0
-                       }
-               ]
-       },
-       "KnockedDown":
-       {
-               "type": "Hit",
-               "delay": 0.1,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 16
-                       },
-                       {
-                               "index": 15
-                       }
-               ]
-       },
-       "Flattened":
-       {
-               "type": "Hit",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 13
-                       }
-               ]
-       }
-}
diff --git a/data/animations/AlienWarrior.lua b/data/animations/AlienWarrior.lua
new file mode 100644 (file)
index 0000000..b722e97
--- /dev/null
@@ -0,0 +1,157 @@
+
+-- Animation sequences for the alien warrior dude
+
+print "loading alien warrior animation sequences"
+
+DefineSequence("Stand",
+{
+       class = STAND,
+       delay = 1,
+       frames = {
+               { index = 0, duration = 2 },
+               { index = 1, duration = 0.25 },
+               { index = 2, duration = 2 },
+               { index = 1, duration = 0.25 }
+       }
+})
+
+DefineSequence("Run",
+{
+       class = RUN,
+       delay = 0.25,
+       frames = {
+               { index = 3 },
+               { index = 4 },
+               { index = 5 },
+               { index = 6 }
+       }
+})
+
+DefineSequence("StopRunning",
+{
+       class = RUN,
+       delay = 0.25,
+       following = "Stand",
+       loop = true,
+       frames = {
+               { index = 7 }
+       }
+})
+
+DefineSequence("Jump",
+{
+       class = JUMP,
+       delay = 0.25,
+       following = "FlyDiagonallyUp",
+       frames = {
+               { index = 17 }
+       }
+})
+
+DefineSequence("Land",
+{
+       class = STAND,
+       delay = 1,
+       following = "Stand",
+       frames = {
+               { index = 13, duration = 0.25 }
+       }
+})
+
+DefineSequence("FlyDiagonallyUp",
+{
+       class = FLY,
+       delay = 0.1,
+       frames = {
+               { index = 18 }
+       }
+})
+
+DefineSequence("FlyDiagonallyDown",
+{
+       class = FLY,
+       delay = 0.1,
+       frames = {
+               { index = 19 }
+       }
+})
+
+DefineSequence("FlyStraightUp",
+{
+       class = FLY,
+       delay = 0.1,
+       frames = {
+               { index = 19 }
+       }
+})
+
+DefineSequence("FlyStraightUp",
+{
+       class = FLY,
+       frames = {
+               { index = 3 }
+       }
+})
+
+DefineSequence("Punch",
+{
+       class = ATTACK,
+       delay = 0.2,
+       frames = {
+               { index = 8 },
+               { index = 9 }
+       }
+})
+
+DefineSequence("StartFiring",
+{
+       class = ATTACK,
+       delay = 0.1,
+       following = "Fire",
+       frames = {
+               { index = 0 },
+               { index = 8 }
+       }
+})
+
+DefineSequence("Fire",
+{
+       class = ATTACK,
+       delay = 1,
+       frames = {
+               { index = 10, duration = 0.2 },
+               { index = 12, duration = 0.2 }
+       }
+})
+
+DefineSequence("StopFiring",
+{
+       class = ATTACK,
+       delay = 0.1,
+       following = "Stand",
+       frames = {
+               { index = 8 },
+               { index = 0 }
+       }
+})
+
+DefineSequence("KnockedDown",
+{
+       class = HIT,
+       delay = 0.1,
+       loop = true,
+       frames = {
+               { index = 16 },
+               { index = 15 }
+       }
+})
+
+DefineSequence("Flattened",
+{
+       class = HIT,
+       delay = 1,
+       frames = {
+               { index = 13 }
+       }
+})
+
diff --git a/data/animations/BigExplosion.json b/data/animations/BigExplosion.json
deleted file mode 100644 (file)
index 32aad03..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-       "BigExplosion":
-       {
-               "delay": 0.1,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 0
-                       },
-                       {
-                               "index": 1
-                       },
-                       {
-                               "index": 2
-                       },
-                       {
-                               "index": 3
-                       },
-                       {
-                               "index": 4
-                       },
-                       {
-                               "index": 5
-                       }
-               ]
-       }
-}
diff --git a/data/animations/BigExplosion.lua b/data/animations/BigExplosion.lua
new file mode 100644 (file)
index 0000000..bc2ff49
--- /dev/null
@@ -0,0 +1,19 @@
+
+-- Big explosion animation sequence
+
+print "loading big explosion animation sequence"
+
+DefineSequence("BigExplosion",
+{
+       delay = 0.1,
+       loop = true,
+       frames = {
+               { index = 0 },
+               { index = 1 },
+               { index = 2 },
+               { index = 3 },
+               { index = 4 },
+               { index = 5 }
+       }
+})
+
diff --git a/data/animations/Bonuses.json b/data/animations/Bonuses.json
deleted file mode 100644 (file)
index 9bd61b7..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-{
-       "SmallHealth":
-       {
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 0
-                       },
-                       {
-                               "index": 1
-                       },
-                       {
-                               "index": 2
-                       },
-                       {
-                               "index": 1
-                       }
-               ]
-       },
-       "LargeHealth":
-       {
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 3
-                       },
-                       {
-                               "index": 4
-                       },
-                       {
-                               "index": 5
-                       },
-                       {
-                               "index": 4
-                       }
-               ]
-       },
-       "SmallRedPotion":
-       {
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 6
-                       },
-                       {
-                               "index": 7
-                       },
-                       {
-                               "index": 8
-                       },
-                       {
-                               "index": 7
-                       }
-               ]
-       },
-       "SmallBluePotion":
-       {
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 9
-                       },
-                       {
-                               "index": 10
-                       },
-                       {
-                               "index": 11
-                       },
-                       {
-                               "index": 10
-                       }
-               ]
-       },
-       "FirstAidKit":
-       {
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 12
-                       }
-               ]
-       },
-       "AlienFirstAidKit":
-       {
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 13
-                       }
-               ]
-       },
-       "Cake":
-       {
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 14
-                       }
-               ]
-       },
-       "FizzyDrink":
-       {
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 15
-                       }
-               ]
-       },
-       "Cheese":
-       {
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 16
-                       }
-               ]
-       },
-       "Chocolate":
-       {
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 17
-                       }
-               ]
-       },
-       "MilkBottle":
-       {
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 18
-                       }
-               ]
-       },
-       "OneSadCookie":
-       {
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 19
-                       }
-               ]
-       }
-}
diff --git a/data/animations/Bonuses.lua b/data/animations/Bonuses.lua
new file mode 100644 (file)
index 0000000..be3a504
--- /dev/null
@@ -0,0 +1,111 @@
+
+-- Bonus animation sequences
+
+DefineSequence("SmallHealth",
+{
+       delay = 0.1,
+       frames = {
+               { index = 0 },
+               { index = 1 },
+               { index = 2 },
+               { index = 1 }
+       }
+})
+
+DefineSequence("LargeHealth",
+{
+       delay = 0.1,
+       frames = {
+               { index = 3 },
+               { index = 4 },
+               { index = 5 },
+               { index = 4 }
+       }
+})
+
+DefineSequence("SmallRedPotion",
+{
+       delay = 0.1,
+       frames = {
+               { index = 6 },
+               { index = 7 },
+               { index = 8 },
+               { index = 7 }
+       }
+})
+
+DefineSequence("SmallBluePotion",
+{
+       delay = 0.1,
+       frames = {
+               { index = 9 },
+               { index = 10 },
+               { index = 11 },
+               { index = 10 }
+       }
+})
+
+DefineSequence("FirstAidKit",
+{
+       delay = 1,
+       frames = {
+               { index = 12 }
+       }
+})
+
+DefineSequence("AlienFirstAidKit",
+{
+       delay = 1,
+       frames = {
+               { index = 13 }
+       }
+})
+
+DefineSequence("Cake",
+{
+       delay = 1,
+       frames = {
+               { index = 14 }
+       }
+})
+
+DefineSequence("FizzyDrink",
+{
+       delay = 1,
+       frames = {
+               { index = 15 }
+       }
+})
+
+DefineSequence("Cheese",
+{
+       delay = 1,
+       frames = {
+               { index = 16 }
+       }
+})
+
+DefineSequence("Chocolate",
+{
+       delay = 1,
+       frames = {
+               { index = 17 }
+       }
+})
+
+DefineSequence("MilkBottle",
+{
+       delay = 1,
+       frames = {
+               { index = 18 }
+       }
+})
+
+DefineSequence("OneSadCookie",
+{
+       delay = 1,
+       frames = {
+               { index = 19 }
+       }
+})
+
diff --git a/data/animations/Bullets.json b/data/animations/Bullets.json
deleted file mode 100644 (file)
index d92428f..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-{
-       "Punch":
-       {
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 31
-                       }
-               ]
-       },
-       "SmallBullet":
-       {
-               "delay": 0.05,
-               "frames":
-               [
-                       {
-                               "index": 16
-                       },
-                       {
-                               "index": 17
-                       }
-               ]
-       },
-       "MediumBullet":
-       {
-               "delay": 0.05,
-               "frames":
-               [
-                       {
-                               "index": 17
-                       },
-                       {
-                               "index": 18
-                       }
-               ]
-       },
-       "SmallFireball":
-       {
-               "delay": 0.05,
-               "frames":
-               [
-                       {
-                               "index": 0
-                       },
-                       {
-                               "index": 1
-                       }
-               ]
-       },
-       "MediumFireball":
-       {
-               "delay": 0.05,
-               "frames":
-               [
-                       {
-                               "index": 2
-                       },
-                       {
-                               "index": 1
-                       }
-               ]
-       },
-       "LargeFireball":
-       {
-               "delay": 0.05,
-               "frames":
-               [
-                       {
-                               "index": 21
-                       },
-                       {
-                               "index": 2
-                       }
-               ]
-       }
-}
diff --git a/data/animations/Bullets.lua b/data/animations/Bullets.lua
new file mode 100644 (file)
index 0000000..5c16b11
--- /dev/null
@@ -0,0 +1,56 @@
+
+-- Bullet animation sequences
+
+DefineSequence("Punch",
+{
+       delay = 1,
+       frames = {
+               { index = 31 }
+       }
+})
+
+DefineSequence("SmallBullet",
+{
+       delay = 0.05,
+       frames = {
+               { index = 16 },
+               { index = 17 }
+       }
+})
+
+DefineSequence("MediumBullet",
+{
+       delay = 0.05,
+       frames = {
+               { index = 17 },
+               { index = 18 }
+       }
+})
+
+DefineSequence("SmallFireball",
+{
+       delay = 0.05,
+       frames = {
+               { index = 0 },
+               { index = 1 }
+       }
+})
+
+DefineSequence("MediumFireball",
+{
+       delay = 0.05,
+       frames = {
+               { index = 2 },
+               { index = 1 }
+       }
+})
+
+DefineSequence("LargeFireball",
+{
+       delay = 0.05,
+       frames = {
+               { index = 21 },
+               { index = 2 }
+       }
+})
+
diff --git a/data/animations/Effects.json b/data/animations/Effects.json
deleted file mode 100644 (file)
index 03b877f..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-{
-       "Fireball":
-       {
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 0
-                       },
-                       {
-                               "index": 1
-                       },
-                       {
-                               "index": 2
-                       },
-                       {
-                               "index": 1
-                       },
-                       {
-                               "index": 0
-                       }
-               ]
-       },
-       "Smoke":
-       {
-               "delay": 0.05,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 4
-                       },
-                       {
-                               "index": 5
-                       },
-                       {
-                               "index": 6
-                       }
-               ]
-       },
-       "GreenDiamond":
-       {
-               "delay": 0.05,
-               "frames":
-               [
-                       {
-                               "index": 7
-                       },
-                       {
-                               "index": 8
-                       },
-                       {
-                               "index": 9
-                       },
-                       {
-                               "index": 10
-                       },
-                       {
-                               "index": 11
-                       }
-               ]
-       },
-       "ChargeParticle":
-       {
-               "delay": 0.03,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 12
-                       },
-                       {
-                               "index": 13
-                       },
-                       {
-                               "index": 1
-                       },
-                       {
-                               "index": 3
-                       },
-                       {
-                               "index": 14
-                       },
-                       {
-                               "index": 13
-                       },
-                       {
-                               "index": 12
-                       }
-               ]
-       },
-       "Poof":
-       {
-               "delay": 0.05,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 23
-                       },
-                       {
-                               "index": 24
-                       },
-                       {
-                               "index": 25
-                       },
-                       {
-                               "index": 26
-                       },
-                       {
-                               "index": 27
-                       }
-               ]
-       }
-}
diff --git a/data/animations/Effects.lua b/data/animations/Effects.lua
new file mode 100644 (file)
index 0000000..d67fd3c
--- /dev/null
@@ -0,0 +1,66 @@
+
+-- Special effect animation sequences
+
+DefineSequence("Fireball",
+{
+       delay = 0.1,
+       frames = {
+               { index = 0 },
+               { index = 1 },
+               { index = 2 },
+               { index = 1 },
+               { index = 0 }
+       }
+})
+
+DefineSequence("Smoke",
+{
+       delay = 0.05,
+       loop = true,
+       frames = {
+               { index = 4 },
+               { index = 5 },
+               { index = 6 }
+       }
+})
+
+DefineSequence("GreenDiamond",
+{
+       delay = 0.05,
+       frames = {
+               { index = 7 },
+               { index = 8 },
+               { index = 9 },
+               { index = 10 },
+               { index = 11 }
+       }
+})
+
+DefineSequence("ChargeParticle",
+{
+       delay = 0.03,
+       loop = true,
+       frames = {
+               { index = 12 },
+               { index = 13 },
+               { index = 1 },
+               { index = 3 },
+               { index = 14 },
+               { index = 13 },
+               { index = 12 }
+       }
+})
+
+DefineSequence("Poof",
+{
+       delay = 0.05,
+       loop = true,
+       frames = {
+               { index = 23 },
+               { index = 24 },
+               { index = 25 },
+               { index = 26 },
+               { index = 27 }
+       }
+})
+
diff --git a/data/animations/Heroine.json b/data/animations/Heroine.json
deleted file mode 100644 (file)
index ca47ea0..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-{
-       "Stand":
-       {
-               "type": "Stand",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 1,
-                               "duration": 4
-                       },
-                       {
-                               "index": 3,
-                               "duration": 0.1
-                       },
-                       {
-                               "index": 1,
-                               "duration": 0.1
-                       },
-                       {
-                               "index": 3,
-                               "duration": 0.1
-                       },
-                       {
-                               "index": 1,
-                               "duration": 2
-                       },
-                       {
-                               "index": 0,
-                               "duration": 2
-                       },
-                       {
-                               "index": 1,
-                               "duration": 0.1
-                       },
-                       {
-                               "index": 2,
-                               "duration": 2
-                       },
-                       {
-                               "index": 1,
-                               "duration": 3
-                       },
-                       {
-                               "index": 3,
-                               "duration": 0.1
-                       },
-                       {
-                               "index": 1,
-                               "duration": 0.1
-                       },
-                       {
-                               "index": 3,
-                               "duration": 0.1
-                       },
-                       {
-                               "index": 1,
-                               "duration": 2
-                       },
-                       {
-                               "index": 0,
-                               "duration": 4
-                       },
-                       {
-                               "index": 1,
-                               "duration": 0.1
-                       },
-                       {
-                               "index": 2,
-                               "duration": 3
-                       },
-                       {
-                               "index": 1,
-                               "duration": 0.1
-                       },
-                       {
-                               "index": 0,
-                               "duration": 1
-                       },
-                       {
-                               "index": 1,
-                               "duration": 2
-                       },
-                       {
-                               "index": 3,
-                               "duration": 0.1
-                       },
-                       {
-                               "index": 1,
-                               "duration": 0.1
-                       },
-                       {
-                               "index": 3,
-                               "duration": 0.1
-                       }
-               ]
-       },
-       "Blink":
-       {
-               "type": "Stand",
-               "next": "Stand",
-               "delay": 0.25,
-               "frames":
-               [
-                       {
-                               "index": 3,
-                               "duration": 0.25
-                       }
-               ]
-       },
-       "Run":
-       {
-               "type": "Run",
-               "delay": 0.25,
-               "frames":
-               [
-                       {
-                               "index": 4
-                       },
-                       {
-                               "index": 5
-                       },
-                       {
-                               "index": 6
-                       },
-                       {
-                               "index": 7
-                       }
-               ]
-       },
-       "StopRunning":
-       {
-               "type": "Stand",
-               "next": "Stand",
-               "delay": 10,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 8
-                       }
-               ]
-       },
-       "Jump":
-       {
-               "type": "Jump",
-               "next": "FlyDiagonallyUp",
-               "delay": 0.25,
-               "frames":
-               [
-                       {
-                               "index": 9,
-                               "duration": 0.25
-                       }
-               ]
-       },
-       "Land":
-       {
-               "type": "Stand",
-               "next": "StopRunning",
-               "delay": 0.5,
-               "frames":
-               [
-                       {
-                               "index": 9,
-                               "duration": 0.25
-                       }
-               ]
-       },
-       "FlyDiagonallyUp":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 10
-                       },
-                       {
-                               "index": 11
-                       }
-               ]
-       },
-       "FlyDiagonallyDown":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 12
-                       },
-                       {
-                               "index": 13
-                       }
-               ]
-       },
-       "FlyStraightUp":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 0
-                       }
-               ]
-       },
-       "FlyHorizontally":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 4
-                       },
-                       {
-                               "index": 14
-                       }
-               ]
-       },
-       "KnockedDown":
-       {
-               "type": "Hit",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 17
-                       },
-                       {
-                               "index": 18
-                       }
-               ]
-       },
-       "Flattened":
-       {
-               "type": "Hit",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 19
-                       }
-               ]
-       },
-       "StartCharging":
-       {
-               "type": "Charge",
-               "next": "Charge",
-               "delay": 0.2,
-               "frames":
-               [
-                       {
-                               "index": 21
-                       }
-               ]
-       },
-       "Charge":
-       {
-               "type": "Charge",
-               "delay": 0.2,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 22
-                       }
-               ]
-       },
-       "FireCharge":
-       {
-               "type": "Charge",
-               "delay": 0.2,
-               "frames":
-               [
-                       {
-                               "index": 23
-                       }
-               ]
-       }
-}
diff --git a/data/animations/Heroine.lua b/data/animations/Heroine.lua
new file mode 100644 (file)
index 0000000..02ca422
--- /dev/null
@@ -0,0 +1,175 @@
+
+-- Animation sequences for the Heroine
+
+print "loading Heroine animation sequences"
+
+
+DefineSequence("Stand",
+{
+       class = STAND,
+       delay = 1,
+       frames = {
+               { index = 1, duration = 4 },
+               { index = 3, duration = 0.1 },
+               { index = 1, duration = 0.1 },
+               { index = 3, duration = 0.1 },
+               { index = 1, duration = 2 },
+               { index = 0, duration = 2 },
+               { index = 1, duration = 0.1 },
+               { index = 2, duration = 2 },
+               { index = 1, duration = 3 },
+               { index = 3, duration = 0.1 },
+               { index = 1, duration = 0.1 },
+               { index = 3, duration = 0.1 },
+               { index = 1, duration = 2 },
+               { index = 0, duration = 4 },
+               { index = 1, duration = 0.1 },
+               { index = 2, duration = 3 },
+               { index = 1, duration = 0.1 },
+               { index = 0, duration = 1 },
+               { index = 1, duration = 2 },
+               { index = 3, duration = 0.1 },
+               { index = 1, duration = 0.1 },
+               { index = 3, duration = 0.1 }
+       }
+})
+
+DefineSequence("Blink",
+{
+       class = STAND,
+       delay = 0.25,
+       following = "Stand",
+       frames = {
+               { index = 3, duration = 0.25 }
+       }
+})
+
+DefineSequence("Run",
+{
+       class = RUN,
+       delay = 0.25,
+       frames = {
+               { index = 4 },
+               { index = 5 },
+               { index = 6 },
+               { index = 7 }
+       }
+})
+
+DefineSequence("StopRunning",
+{
+       class = STAND,
+       delay = 10,
+       following = "Stand",
+       loop = true,
+       frames = {
+               { index = 8 }
+       }
+})
+
+DefineSequence("Jump",
+{
+       class = JUMP,
+       following = "FlyDiagonallyUp",
+       delay = 0.25,
+       frames = {
+               { index = 9, duration = 0.25 }
+       }
+})
+
+DefineSequence("Land",
+{
+       class = STAND,
+       delay = 0.5,
+       following = "StopRunning",
+       frames = {
+               { index = 9, duration = 0.25 }
+       }
+})
+
+DefineSequence("FlyDiagonallyUp",
+{
+       class = FLY,
+       delay = 0.1,
+       frames = {
+               { index = 10 },
+               { index = 11 }
+       }
+})
+
+DefineSequence("FlyDiagonallyDown",
+{
+       class = FLY,
+       delay = 0.1,
+       frames = {
+               { index = 12 },
+               { index = 13 }
+       }
+})
+
+DefineSequence("FlyStraightUp",
+{
+       class = FLY,
+       delay = 0.1,
+       frames = {
+               { index = 0 }
+       }
+})
+
+DefineSequence("FlyHorizontally",
+{
+       class = FLY,
+       frames = {
+               { index = 4 },
+               { index = 14 }
+       }
+})
+
+DefineSequence("StartCharging",
+{
+       class = CHARGE,
+       delay = 0.2,
+       following = "Charge",
+       frames = {
+               { index = 21 }
+       }
+})
+
+DefineSequence("Charge",
+{
+       class = CHARGE,
+       delay = 0.2,
+       loop = true,
+       frames = {
+               { index = 22 }
+       }
+})
+
+DefineSequence("FireCharge",
+{
+       class = CHARGE,
+       delay = 0.2,
+       frames = {
+               { index = 23 }
+       }
+})
+
+DefineSequence("KnockedDown",
+{
+       class = HIT,
+       delay = 0.1,
+       frames = {
+               { index = 17 },
+               { index = 18 }
+       }
+})
+
+DefineSequence("Flattened",
+{
+       class = HIT,
+       delay = 1,
+       frames = {
+               { index = 19 }
+       }
+})
+
diff --git a/data/animations/Jetbot.json b/data/animations/Jetbot.json
deleted file mode 100644 (file)
index f5f3152..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-{
-       "Stand":
-       {
-               "type": "Stand",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 0,
-                               "duration": 2
-                       },
-                       {
-                               "index": 1,
-                               "duration": 0.25
-                       },
-                       {
-                               "index": 2,
-                               "duration": 2
-                       },
-                       {
-                               "index": 1,
-                               "duration": 0.25
-                       }
-               ]
-       },
-       "Run":
-       {
-               "type": "Run",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 3
-                       },
-                       {
-                               "index": 4
-                       }
-               ]
-       },
-       "StopRunning":
-       {
-               "type": "Stand",
-               "next": "Stand",
-               "delay": 10,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 6
-                       }
-               ]
-       },
-       "Jump":
-       {
-               "type": "Jump",
-               "next": "FlyDiagonallyUp",
-               "delay": 0.25,
-               "frames":
-               [
-                       {
-                               "index": 6
-                       }
-               ]
-       },
-       "Land":
-       {
-               "type": "Stand",
-               "next": "Stand",
-               "delay": 1,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 6,
-                               "duration": 0.25
-                       },
-                       {
-                               "index": 0,
-                               "duration": 0.25
-                       }
-               ]
-       },
-       "FlyDiagonallyUp":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 3
-                       },
-                       {
-                               "index": 4
-                       }
-               ]
-       },
-       "FlyDiagonallyDown":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 3
-                       },
-                       {
-                               "index": 4
-                       }
-               ]
-       },
-       "FlyStraightUp":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 3
-                       },
-                       {
-                               "index": 4
-                       }
-               ]
-       },
-       "FlyHorizontally":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 3
-                       },
-                       {
-                               "index": 4
-                       }
-               ]
-       },
-       "Punch":
-       {
-               "type": "Attack",
-               "next": "Stand",
-               "delay": 0.05,
-               "frames":
-               [
-                       {
-                               "index": 3
-                       }
-               ]
-       },
-       "StartFiring":
-       {
-               "type": "Attack",
-               "next": "Fire",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 3
-                       }
-               ]
-       },
-       "Fire":
-       {
-               "type": "Attack",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 3,
-                               "duration": 0.2
-                       }
-               ]
-       },
-       "StopFiring":
-       {
-               "type": "Attack",
-               "next": "Stand",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 3
-                       }
-               ]
-       },
-       "KnockedDown":
-       {
-               "type": "Hit",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 5
-                       }
-               ]
-       },
-       "Flattened":
-       {
-               "type": "Hit",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 6
-                       }
-               ]
-       }
-}
diff --git a/data/animations/Jetbot.lua b/data/animations/Jetbot.lua
new file mode 100644 (file)
index 0000000..d2cade7
--- /dev/null
@@ -0,0 +1,157 @@
+
+-- Animation sequences for the Jet Bot
+
+print "loading JetBot animation sequences"
+
+
+DefineSequence("Stand",
+{
+       class = STAND,
+       delay = 1,
+       frames = {
+               { index = 0, duration = 2 },
+               { index = 1, duration = 0.25 },
+               { index = 2, duration = 2 },
+               { index = 1, duration = 0.25 }
+       }
+})
+
+DefineSequence("Run",
+{
+       class = RUN,
+       delay = 0.1,
+       frames = {
+               { index = 3 },
+               { index = 4 }
+       }
+})
+
+DefineSequence("StopRunning",
+{
+       class = STAND,
+       delay = 10,
+       following = "Stand",
+       loop = true,
+       frames = {
+               { index = 6 }
+       }
+})
+
+DefineSequence("Jump",
+{
+       class = JUMP,
+       following = "FlyDiagonallyUp",
+       delay = 0.25,
+       frames = {
+               { index = 6 }
+       }
+})
+
+DefineSequence("Land",
+{
+       class = STAND,
+       delay = 1,
+       following = "Stand",
+       loop = true,
+       frames = {
+               { index = 6, duration = 0.25 },
+               { index = 0, duration = 0.25 }
+       }
+})
+
+DefineSequence("FlyDiagonallyUp",
+{
+       class = FLY,
+       delay = 0.1,
+       frames = {
+               { index = 3 },
+               { index = 4 }
+       }
+})
+
+DefineSequence("FlyDiagonallyDown",
+{
+       class = FLY,
+       delay = 0.1,
+       frames = {
+               { index = 3 },
+               { index = 4 }
+       }
+})
+
+DefineSequence("FlyStraightUp",
+{
+       class = FLY,
+       delay = 0.1,
+       frames = {
+               { index = 3 },
+               { index = 4 }
+       }
+})
+
+DefineSequence("FlyHorizontally",
+{
+       class = FLY,
+       frames = {
+               { index = 3 },
+               { index = 4 }
+       }
+})
+
+DefineSequence("Punch",
+{
+       class = ATTACK,
+       delay = 0.05,
+       following = "Stand",
+       frames = {
+               { index = 3 }
+       }
+})
+
+DefineSequence("StartFiring",
+{
+       class = ATTACK,
+       delay = 0.1,
+       following = "Fire",
+       frames = {
+               { index = 3 }
+       }
+})
+
+DefineSequence("Fire",
+{
+       class = ATTACK,
+       delay = 1,
+       frames = {
+               { index = 3, duration = 0.2 }
+       }
+})
+
+DefineSequence("StopFiring",
+{
+       class = ATTACK,
+       delay = 0.1,
+       following = "Stand",
+       frames = {
+               { index = 3 }
+       }
+})
+
+DefineSequence("KnockedDown",
+{
+       class = HIT,
+       delay = 1,
+       frames = {
+               { index = 5 }
+       }
+})
+
+DefineSequence("Flattened",
+{
+       class = HIT,
+       delay = 1,
+       frames = {
+               { index = 6 }
+       }
+})
+
diff --git a/data/animations/RobotTrooper.json b/data/animations/RobotTrooper.json
deleted file mode 100644 (file)
index fcdf579..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-{
-       "Stand":
-       {
-               "type": "Stand",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 0,
-                               "duration": 2
-                       },
-                       {
-                               "index": 1,
-                               "duration": 0.25
-                       },
-                       {
-                               "index": 2,
-                               "duration": 2
-                       },
-                       {
-                               "index": 1,
-                               "duration": 0.25
-                       }
-               ]
-       },
-       "Run":
-       {
-               "type": "Run",
-               "delay": 0.25,
-               "frames":
-               [
-                       {
-                               "index": 4
-                       },
-                       {
-                               "index": 5
-                       },
-                       {
-                               "index": 6
-                       },
-                       {
-                               "index": 7
-                       }
-               ]
-       },
-       "StopRunning":
-       {
-               "type": "Stand",
-               "next": "Stand",
-               "delay": 10,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 5
-                       }
-               ]
-       },
-       "Jump":
-       {
-               "type": "Jump",
-               "next": "FlyDiagonallyUp",
-               "delay": 0.25,
-               "frames":
-               [
-                       {
-                               "index": 17
-                       }
-               ]
-       },
-       "Land":
-       {
-               "type": "Stand",
-               "next": "Stand",
-               "delay": 1,
-               "loop": true,
-               "frames":
-               [
-                       {
-                               "index": 19,
-                               "duration": 0.25
-                       },
-                       {
-                               "index": 14,
-                               "duration": 0.25
-                       }
-               ]
-       },
-       "FlyDiagonallyUp":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 18
-                       }
-               ]
-       },
-       "FlyDiagonallyDown":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 18
-                       }
-               ]
-       },
-       "FlyStraightUp":
-       {
-               "type": "Fly",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 18
-                       }
-               ]
-       },
-       "FlyHorizontally":
-       {
-               "type": "Fly",
-               "frames":
-               [
-                       {
-                               "index": 18
-                       }
-               ]
-       },
-       "Punch":
-       {
-               "type": "Attack",
-               "next": "Stand",
-               "delay": 0.05,
-               "frames":
-               [
-                       {
-                               "index": 8
-                       },
-                       {
-                               "index": 9
-                       },
-                       {
-                               "index": 10
-                       },
-                       {
-                               "index": 11
-                       },
-                       {
-                               "index": 12
-                       },
-                       {
-                               "index": 13
-                       }
-               ]
-       },
-       "StartFiring":
-       {
-               "type": "Attack",
-               "next": "Fire",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 14
-                       },
-                       {
-                               "index": 15
-                       },
-                       {
-                               "index": 16
-                       }
-               ]
-       },
-       "Fire":
-       {
-               "type": "Attack",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 17,
-                               "duration": 0.2
-                       },
-                       {
-                               "index": 16,
-                               "duration": 0.2
-                       }
-               ]
-       },
-       "StopFiring":
-       {
-               "type": "Attack",
-               "next": "Stand",
-               "delay": 0.1,
-               "frames":
-               [
-                       {
-                               "index": 16
-                       },
-                       {
-                               "index": 15
-                       },
-                       {
-                               "index": 14
-                       }
-               ]
-       },
-       "KnockedDown":
-       {
-               "type": "Hit",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 18
-                       }
-               ]
-       },
-       "Flattened":
-       {
-               "type": "Hit",
-               "delay": 1,
-               "frames":
-               [
-                       {
-                               "index": 19
-                       }
-               ]
-       }
-}
diff --git a/data/animations/RobotTrooper.lua b/data/animations/RobotTrooper.lua
new file mode 100644 (file)
index 0000000..3a15da2
--- /dev/null
@@ -0,0 +1,165 @@
+
+-- Animation sequences for the robot trooper bad guy
+
+print "loading RobotTrooper animation sequences"
+
+
+DefineSequence("Stand",
+{
+       class = STAND,
+       delay = 1,
+       frames = {
+               { index = 0, duration = 2 },
+               { index = 1, duration = 0.25 },
+               { index = 2, duration = 2 },
+               { index = 1, duration = 0.25 }
+       }
+})
+
+DefineSequence("Run",
+{
+       class = RUN,
+       delay = 0.25,
+       frames = {
+               { index = 4 },
+               { index = 5 },
+               { index = 6 },
+               { index = 7 }
+       }
+})
+
+DefineSequence("StopRunning",
+{
+       class = STAND,
+       delay = 0.25,
+       following = "Stand",
+       loop = true,
+       frames = {
+               { index = 5 }
+       }
+})
+
+DefineSequence("Jump",
+{
+       class = JUMP,
+       following = "FlyDiagonallyUp",
+       delay = 0.25,
+       frames = {
+               { index = 17 }
+       }
+})
+
+DefineSequence("Land",
+{
+       class = STAND,
+       delay = 1,
+       following = "Stand",
+       loop = true,
+       frames = {
+               { index = 19, duration = 0.25 },
+               { index = 14, duration = 0.25 }
+       }
+})
+
+DefineSequence("FlyDiagonallyUp",
+{
+       class = FLY,
+       delay = 0.1,
+       frames = {
+               { index = 18 }
+       }
+})
+
+DefineSequence("FlyDiagonallyDown",
+{
+       class = FLY,
+       delay = 0.1,
+       frames = {
+               { index = 18 }
+       }
+})
+
+DefineSequence("FlyStraightUp",
+{
+       class = FLY,
+       delay = 0.1,
+       frames = {
+               { index = 18 }
+       }
+})
+
+DefineSequence("FlyHorizontally",
+{
+       class = FLY,
+       frames = {
+               { index = 18 }
+       }
+})
+
+DefineSequence("Punch",
+{
+       class = ATTACK,
+       delay = 0.05,
+       following = "Stand",
+       frames = {
+               { index = 8 },
+               { index = 9 },
+               { index = 10 },
+               { index = 11 },
+               { index = 12 },
+               { index = 13 }
+       }
+})
+
+DefineSequence("StartFiring",
+{
+       class = ATTACK,
+       delay = 0.1,
+       following = "Fire",
+       frames = {
+               { index = 14 },
+               { index = 15 },
+               { index = 16 }
+       }
+})
+
+DefineSequence("Fire",
+{
+       class = ATTACK,
+       delay = 1,
+       frames = {
+               { index = 17, duration = 0.2 },
+               { index = 16, duration = 0.2 }
+       }
+})
+
+DefineSequence("StopFiring",
+{
+       class = ATTACK,
+       delay = 0.1,
+       following = "Stand",
+       frames = {
+               { index = 16 },
+               { index = 15 },
+               { index = 14 }
+       }
+})
+
+DefineSequence("KnockedDown",
+{
+       class = HIT,
+       delay = 1,
+       frames = {
+               { index = 18 }
+       }
+})
+
+DefineSequence("Flattened",
+{
+       class = HIT,
+       delay = 1,
+       frames = {
+               { index = 19 }
+       }
+})
+
This page took 0.070273 seconds and 4 git commands to generate.