Hello Zoq2,
here some code
function GameSetupPhysics( )
SetPhysicsDebugOn ( )
SetPhysicsCCD ( 1 )
SetPhysicsWallTop ( 1 )
SetPhysicsWallBottom( 0 )
SetPhysicsWallRight ( 1 )
SetPhysicsWallLeft ( 1 )
SetSpritePhysicsOn ( g_iPaddleID, 1 )
SetSpritePhysicsOn ( g_iBallID, 2 )
SetSpritePhysicsFriction ( g_iPaddleID, 0.5 )
SetSpritePhysicsFriction ( g_iBallID, 0.5 )
SetSpriteShapeCircle ( g_iBallID, 0, 0, 2 )
SetSpriteShapeBox ( g_iPaddleID, 0, 0, 20, 2, 0 )
SetSpritePhysicsRestitution( g_iPaddleID, 1.0 )
SetSpritePhysicsRestitution( g_iBallID, 0.7 )
SetSpritePhysicsMass ( g_iBallID, 1.0 )
endfunction
function GameUpdateBall( )
if ( g_iBallOnPaddle )
SetSpritePosition( g_iBallID, GetSpriteX( g_iPaddleID ) + ( GetSpriteWidth( g_iPaddleID ) / 2 ) - 2 , GetSpriteY( g_iPaddleID ) - 1 )
endif
if ( GetSpriteY( g_iBallID ) > 100 )
g_iBallOnPaddle = 1
endif
if ( GetPhysicsCollision( g_iBallID,g_iPaddleID ) and g_iBallOnPaddle = 0 )
SetSpritePhysicsImpulse( g_iBallID, GetSpriteX( g_iBallID ), GetSpriteY( g_iBallID ), RandomSign( Random( 0, 50 ) ), -70 )
endif
endfunction
The Backvalue is always 0