So I was just playing around with the Physics engine, and I added a few lines of code to the sample, here it is:
// display a background
CreateSprite ( LoadImage ( "background4.jpg" ) )
// load an image
LoadImage ( 1, "small_silver.png" )
// create 5 sprites
CreateSprite ( 1, 1 )
CreateSprite ( 2, 1 )
CreateSprite ( 3, 1 )
CreateSprite ( 4, 1 )
CreateSprite ( 5, 1 )
// set their positions
SetSpritePosition ( 1, 0, 0 )
SetSpritePosition ( 2, 50, 0 )
SetSpritePosition ( 3, 100, 0 )
SetSpritePosition ( 4, 150, 0 )
SetSpritePosition ( 5, 200, 0 )
// turn physics on
SetSpritePhysicsOn ( 1, 2 )
SetSpritePhysicsOn ( 2, 2 )
SetSpritePhysicsOn ( 3, 2 )
SetSpritePhysicsOn ( 4, 2 )
SetSpritePhysicsOn ( 5, 2 )
// alter default gravity
SetPhysicsGravity ( 10, 10 )
// main loop
do
// update screeen
for i = 1 to 5
SetSpriteX ( i , (i-1)*50 )
next i
Sync ( )
loop
This is the gravity sample.
Anyways, you can see what I'm doing is trying to keep the blocks stable on the horizontal axis (x), and let the physics do what it wants with the Y axis.
However, when I run this, the blocks don't move at all.
Is this an obvious bug? Or am I missing something?
Thanks,
Jeff
Hi