Good morning,
I tried to follow your instructions by looking at the physics examples in the documentation but I cannot get it right.
I created a static joint for the ground sprite which connects to the first part of the stem, followed by revolute joints connecting the 2 parts of the stem and the upper part of the stem with the bud.
Since I didn't know how to apply negative gravity to the bud (couldn't find anything in the documentation which doesn't automatically apply to all objects) I tried with sprite velocity inside the main loop but this doesn't work as expected - the stem is not straight but bends until it reaches the joint limit.
Please find below my code -
rem
rem AGK Application
rem
rem Landscape App
SetDisplayAspect( 4.0/3.0 )
SetVirtualResolution ( 320, 480 )
rem A Wizard Did It!
LoadImage ( 1, "stem.jpg" )
LoadImage ( 2, "bud.jpg" )
LoadImage ( 3, "Ground.jpg" )
CreateSprite ( 1, 1 )
SetSpritePosition ( 1, 100, 100 )
SetSpritePhysicsOn ( 1, 2 )
CreateSprite ( 2, 1 )
SetSpritePosition ( 2, 100, 163 )
SetSpritePhysicsOn ( 2, 2 )
CreateSprite ( 3, 2 )
SetSpritePosition ( 3, 50, 66 )
SetSpritePhysicsOn ( 3, 2 )
CreateSprite ( 4, 3 )
SetSpritePosition ( 4, 50, 226 )
SetSpritePhysicsOn ( 4, 1 )
CreateRevoluteJoint( 1, 1, 2, 104, 163, 0 )
SetJointLimitOn( 1, 0.5, -0.5 )
CreateRevoluteJoint( 2, 1, 3, 104, 100, 0 )
CreateRevoluteJoint( 3, 2, 4, 104, 226, 0 )
//SetJointMotorOn( 2, 0, 2000 ) // doesn't do anything ...
SetPhysicsDebugOn ( )
do
Print("Gravity test RevoluteJoint")
SetSpritePhysicsVelocity (3,0,-100) // desperate try
Sync()
loop