share/hedgewars/Data/Scripts/Animate.lua
changeset 7448 d0521a3a4358
parent 7438 195f9cbd6df6
child 9245 1dfdf35dd35d
--- a/share/hedgewars/Data/Scripts/Animate.lua	Fri Aug 10 00:20:52 2012 +0300
+++ b/share/hedgewars/Data/Scripts/Animate.lua	Fri Aug 10 04:26:58 2012 +0300
@@ -181,18 +181,26 @@
   return false
 end
 
+function AnimSetGearPosition(gear, destX, destY, fall)
+  SetGearPosition(gear, destX, destY)
+  if fall ~= false then
+    SetGearVelocity(gear, 0, 10)
+  end
+  return true
+end
+
 function AnimDisappear(gear, destX, destY)
 	AddVisualGear(GetX(gear)-5, GetY(gear)-5, vgtSmoke, 0, false)
 	AddVisualGear(GetX(gear)+5, GetY(gear)+5, vgtSmoke, 0, false)
 	AddVisualGear(GetX(gear)-5, GetY(gear)+5, vgtSmoke, 0, false)
 	AddVisualGear(GetX(gear)+5, GetY(gear)-5, vgtSmoke, 0, false)
   PlaySound(sndExplosion)
-	SetGearPosition(gear, destX, destY)
+	AnimSetGearPosition(gear, destX, destY)
   return true
 end
 
 function AnimOutOfNowhere(gear, destX, destY)
-  SetGearPosition(gear, destX, destY)
+  AnimSetGearPosition(gear, destX, destY)
   AddVisualGear(destX, destY, vgtBigExplosion, 0, false)
   PlaySound(sndExplosion)
   AnimGearWait(gear, 50)
@@ -204,7 +212,7 @@
 	AddVisualGear(GetX(gear)+5, GetY(gear)+5, vgtSmoke, 0, false)
 	AddVisualGear(GetX(gear)-5, GetY(gear)+5, vgtSmoke, 0, false)
 	AddVisualGear(GetX(gear)+5, GetY(gear)-5, vgtSmoke, 0, false)
-	SetGearPosition(gear, destX, destY)
+	AnimSetGearPosition(gear, destX, destY)
 	AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
   PlaySound(sndExplosion)
   FollowGear(gear)
@@ -212,11 +220,6 @@
   return true
 end
 
-function AnimSetGearPosition(gear, x, y)
-  SetGearPosition(gear, x, y)
-  return true
-end
-
 function AnimVisualGear(gear, x, y, vgType, state, critical, follow)
   local vgear = AddVisualGear(x, y, vgType, state, critical)
   if follow == true then