Can somebody help me make a physics-based motorbike?
Here's my non-working code:
flor=CreateSprite(0)
SetSpriteSize(flor,100,2)
SetSpritePosition(flor,0,90)
SetSpritePhysicsOn(flor,1)
bike=CreateSprite(0) `The motorbike
SetSpriteSize(bike,20,10)
SetSpritePosition(bike,50,50)
SetSpritePhysicsOn(bike,2)
whl1=CreateSprite(img.circle) `Wheel, img.circle contains imageid of blank white circle
SetSpriteSize(whl1,10,15)
SetSpritePosition(whl1,52-5,58-7.5)
SetSpritePhysicsOn(whl1,2)
SetSpriteShape(whl1,1)
`SetSpriteOffset(whl1,5,7.5)
foo=CreateRevoluteJoint(bike, whl1, 0, 0, 0) `Joint
`SetJointMotorOn( foo, -500, 500 )
`foo=CreateDistanceJoint( bike, whl1, 2, 8, 5, 7.5, 0 )
t=createSprite(0) `Obstacle
SetSpritePosition(t,55,75)
SetSpriteSize(t,2,2)
SetSpritePhysicsOn(t,1)
do
`
`
if GetRawKeystate(27) then end
sync()
loop
The problem is the joint, I'm not sure how they work
It's using the percentage based system