Animate library: Document way to speed up animations for testing purposes
authorWuzzy <Wuzzy2@mail.ru>
Tue, 28 May 2019 17:49:04 +0200
changeset 15073 7732013ce64c
parent 15072 4c40266fae97
child 15074 c5a6e8566425
Animate library: Document way to speed up animations for testing purposes
share/hedgewars/Data/Scripts/Animate.lua
--- a/share/hedgewars/Data/Scripts/Animate.lua	Tue May 28 17:04:48 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Animate.lua	Tue May 28 17:49:04 2019 +0200
@@ -8,6 +8,12 @@
 local skipping
 local baseInputMask = 0xFFFFFFFF
 local extraInputMask = baseInputMask
+
+-- DEBUGGING STUFF --
+--[[ Number of animation ticks to decrease whenever AnimUnWait()
+     is called (usually every game tick). Default: 1
+     Increase this number to increase overall animation speed. ]]
+local animSpeed = 1
 --------------------------------Animation---------------------------------
 --------------------------(In-game cinematics)----------------------------
 
@@ -125,7 +131,10 @@
 
 function AnimUnWait()
   if globalWait > 0 then
-    globalWait = globalWait - 1
+    globalWait = globalWait - animSpeed
+    if globalWait < 0 then
+      globalWait = 0
+    end
   end
 end