Speeding up/Slow down
by baylor wetzel · in Torque Game Builder · 11/25/2007 (10:45 pm) · 2 replies
Is there a built in way to control the speed of the game?
Right now the speed up/slown buttons change the value of moveTo but that doesn't affect other items and it doesn't affect moveTo until the next move command is called. It works OK for us but it would be nice if there were some built in way to say "run 3x as fast until i say otherwise"
btw, i use this in an strategy game my students use to understand AI. When trying to understand a battle, they turn the speed down and when they've figured it out, they crank up the speed to see how it all turns out
Right now the speed up/slown buttons change the value of moveTo but that doesn't affect other items and it doesn't affect moveTo until the next move command is called. It works OK for us but it would be nice if there were some built in way to say "run 3x as fast until i say otherwise"
btw, i use this in an strategy game my students use to understand AI. When trying to understand a battle, they turn the speed down and when they've figured it out, they crank up the speed to see how it all turns out
About the author
#2
$timescale = 1
For twice the speed:
$timescale = 2
For half speed:
$timescale = 0.5
And so on.
11/26/2007 (1:20 pm)
For normal speed:$timescale = 1
For twice the speed:
$timescale = 2
For half speed:
$timescale = 0.5
And so on.
Associate Phillip O'Shea
Violent Tulip
function SomeClass::speedMod(%this, ... , %speedScale) { %objectList = %scenegraph.getSceneObjectList(); %objectCount = getWordCount(%objectList); for (%i = 0; %i < %objectCount; %i++) { %object = getWord(%objectList, %i); if (%object.isSomeCondition) { %velocity = %object.getLinearVelocity(); %velocity.x *= %speedScale; %velocity.y *= %speedScale; %object.setLinearVelocity(%velocity); } } }