Browse Source

Fixed logic in Deathball's updateRollAnimation.

Daniel Buckmaster 12 years ago
parent
commit
3c40301
1 changed files with 3 additions and 6 deletions
  1. 3 6
      modules/DeathBallToy/1/main.cs

+ 3 - 6
modules/DeathBallToy/1/main.cs

@@ -210,7 +210,7 @@ function DeathBallToy::spawnDeathball(%this, %position)
     
     //%db.pauseAnimation(1);
 
-    //Deathball.rollSchedule = Deathball.schedule(100, "updateRollAnimation");
+    Deathball.rollSchedule = Deathball.schedule(100, "updateRollAnimation");
 
     SandboxScene.add(%db);
 
@@ -224,13 +224,10 @@ function Deathball::updateRollAnimation(%this)
     %this.rollSchedule = "";
 
     %velocity = %this.getLinearVelocity();
-
-    %currentAnimTime = %this.getAnimationTime();
     %scaledVelocity = (mAbs(getWord(%velocity, 0))) + mAbs(getWord(%velocity, 1)) / 50;
     %flooredVelocity = mFloatLength(%scaledVelocity, 1);
-    %scaledAnimTime = %currentAnimTime * %flooredVelocity;
 
-    %this.setAnimationTimeScale(%scaledAnimTime);
+    %this.setAnimationTimeScale(%flooredVelocity / 15);
 
     %this.rollSchedule = %this.schedule(100, updateRollAnimation);
 }
@@ -522,4 +519,4 @@ function SandboxWindow::onMouseWheelDown(%this, %modifier, %mousePoint, %mouseCl
     // Don't allow zooming
 }         */
 
-};
+};