I changed to GetSpriteAngle in a third example but I am rather sure the angle should be in degrees. Anyway, the angle is still wrong.
SetVirtualResolution( GetDeviceWidth(), GetDeviceHeight() )
CreateSprite ( 1, LoadImage ( "blue.png" ) )
CreateSprite ( 2, LoadImage ( "blue.png" ) )
CreateSprite ( 3, LoadImage ( "blue.png" ) )
SetSpritePosition ( 1, 10, 10 )
SetSpriteAngle( 1, 45 )
SetSpritePosition ( 2, 100, 100 )
SetSpriteAngle( 2, 45 )
SetSpritePosition ( 3, 200, 200 )
SetSpriteAngle( 3, 45 )
SetPhysicsDebugOn()
//This should work but it does not
SetSpritePhysicsOn ( 1, 1 )
SetSpriteShapeBox( 1, 0, 0, GetSpriteWidth(1), GetSpriteHeight(1), GetSpriteAngleRad(1) )
//This almost work but the angle is wrong
SetSpritePhysicsOn ( 2, 1 )
SetSpriteShapeBox( 2, -1*(GetSpriteWidth(2)/2), -1*(GetSpriteHeight(2)/2), GetSpriteWidth(2)/2, GetSpriteHeight(2)/2, GetSpriteAngleRad(2) )
//Same thing but angle in degrees
SetSpritePhysicsOn ( 3, 1 )
SetSpriteShapeBox( 3, -1*(GetSpriteWidth(3)/2), -1*(GetSpriteHeight(3)/2), GetSpriteWidth(3)/2, GetSpriteHeight(3)/2, GetSpriteAngle(3) )
do
Sync ( )
loop
Sincerely,
Max Tillberg