Different bounce behavior on different OS versions?
by Lennart Steinke · in Torque Game Builder · 03/22/2005 (7:39 am) · 1 replies
Hi!
I was encountering a strange effect. At first I thought it was a bit of my code running amok again, so I started to remove my code. In the end, the result was this:
As expected the ball bounces up and down. But then I had the impression that the ball got faster. And in fact, the ball got faster and faster and at the end it wasn't even showing anymore on screen.
It seems to get faster only on collisions, and the time needed to speed up is also not constant. Run that 3 times and you'll get 3 different times before you'll notice the speed up.
Also, I never saw this problem on my XP box, only with win200 pro.
Any idea what might be causing this?
-Lenny
I was encountering a strange effect. At first I thought it was a bit of my code running amok again, so I started to remove my code. In the end, the result was this:
function setupT2DScene()
{
// Create fxSceneGraph2D.
new fxSceneGraph2D(t2dSceneGraph);
// Associate Scenegraph with Window.
sceneWindow2D.setSceneGraph( t2dSceneGraph );
// Set Camera Position to be centered on (0,0) with
// view width/height of (100/80).
sceneWindow2D.setCurrentCameraPosition( "0 0 100 75" );
// ************************************************************************
//
// Add your custom code here...
//
// ************************************************************************
datablock fxImageMapDatablock2D(ballImgMap)
{
mode = full;
textureName = "~/client/images/ball";
};
$player = new fxStaticSprite2D() { scenegraph = t2dSceneGraph; };
$player.setPosition("0 0");
$player.setSize( "4 4" );
$player.setImageMap( ballImgMap );
$player.setCollisionPolyPrimitive(12);
$player.setCollisionScale("0.95 0.95");
$player.setLinearVelocityY(-40);
$player.setMaxAngularVelocity(0);
$player.setWorldLimit(bounce, "-20 -30.5 20 30.5", true);
}As expected the ball bounces up and down. But then I had the impression that the ball got faster. And in fact, the ball got faster and faster and at the end it wasn't even showing anymore on screen.
It seems to get faster only on collisions, and the time needed to speed up is also not constant. Run that 3 times and you'll get 3 different times before you'll notice the speed up.
Also, I never saw this problem on my XP box, only with win200 pro.
Any idea what might be causing this?
-Lenny
About the author
Torque Owner Lennart Steinke
The next release will be pretty amazing... can hardly wait to see the new demos.