at a glance:
IE, SetSpritePhysicsOn()
before Adding the shapes?
Actually:
SetSpriteShapePolygon ( sID, 5, 0, 0.0, -78.9, 0 ) // number of points = 5
AddSpriteShapePolygon ( sID, 5, 1, 127.9, -14.9 )
AddSpriteShapePolygon ( sID, 5, 2, 0.0, 49.9 )
AddSpriteShapePolygon ( sID, 5, 3, -127.9, -14.9 )
AddSpriteShapePolygon ( sID, 5, 4, 0.0, -78.9 )
...doesn't jibe. you should be using SetSpriteShapePolygon for every Index in order to define the shape. So, something like:
SetSpriteShapePolygon ( sID, 5, 0, 0.0, -78.9, 0 ) // number of points = 5
SetSpriteShapePolygon ( sID, 5, 1, 127.9, -14.9, 0)
SetSpriteShapePolygon ( sID, 5, 2, 0.0, 49.9, 0 )
SetSpriteShapePolygon ( sID, 5, 3, -127.9, -14.9, 0 )
SetSpriteShapePolygon ( sID, 5, 4, 0.0, -78.9, 0 )
...to set the BASE shape of the Sprite.
then, when you want to add ADDITIONAL shapes, begin with AddSpriteShapePolygon() and define the remaining points with continued use of AddSpriteShapePolygon()s while increasing the Index for each until complete.
point: SetSpriteShapePolygon() is completely separate from AddSpriteShapePolygon(); they are not to be used together to form the SAME shape.
i hope that makes sense?
working example of multiple Shapes for the Table in
TableRunner (using Chains vs Polygons):
Table = CreateSprite(TableImg)
SetSpriteGroup(Table,TableGroup)
SetSpritePositionByOffset(Table,HalfWidth#, HalfHeight#)
SetSpritePhysicsOn(Table,1)
SetSpritePhysicsFriction(Table, 0.05)
SetSpritePhysicsRestitution(Table,0.69)
SetSpriteShapeChain(Table,10,0,0,-112,-67,0) `Top Rail + Middle Pocket
SetSpriteShapeChain(Table,10,1,0,-99,-55,0)
SetSpriteShapeChain(Table,10,2,0,-8,-55,0)
SetSpriteShapeChain(Table,10,3,0,-6,-58,0)
SetSpriteShapeChain(Table,10,4,0,-5,-65,0)
SetSpriteShapeChain(Table,10,5,0,5,-65,0)
SetSpriteShapeChain(Table,10,6,0,6,-58,0)
SetSpriteShapeChain(Table,10,7,0,8,-55,0)
SetSpriteShapeChain(Table,10,8,0,99,-55,0)
SetSpriteShapeChain(Table,10,9,0,112,-67,0)
AddSpriteShapeChain(Table,10,0,0,-112,67) `Bottom Rail + Middle Pocket
AddSpriteShapeChain(Table,10,1,0,-99,55)
AddSpriteShapeChain(Table,10,2,0,-8,55)
AddSpriteShapeChain(Table,10,3,0,-6,58)
AddSpriteShapeChain(Table,10,4,0,-5,65)
AddSpriteShapeChain(Table,10,5,0,5,65)
AddSpriteShapeChain(Table,10,6,0,6,58)
AddSpriteShapeChain(Table,10,7,0,8,55)
AddSpriteShapeChain(Table,10,8,0,99,55)
AddSpriteShapeChain(Table,10,9,0,112,67)
AddSpriteShapeChain(Table,6,0,0,-112,-67) `Left Rail + Left Pockets
AddSpriteShapeChain(Table,6,1,0,-119,-59)
AddSpriteShapeChain(Table,6,2,0,-107,-47)
AddSpriteShapeChain(Table,6,3,0,-107,47)
AddSpriteShapeChain(Table,6,4,0,-119,59)
AddSpriteShapeChain(Table,6,5,0,-112,67)
AddSpriteShapeChain(Table,6,0,0,112,-67)
AddSpriteShapeChain(Table,6,1,0,119,-59)
AddSpriteShapeChain(Table,6,2,0,107,-47) `Right Rail + Right Pockets
AddSpriteShapeChain(Table,6,3,0,107,47)
AddSpriteShapeChain(Table,6,4,0,119,59)
AddSpriteShapeChain(Table,6,5,0,112,67)