Play around with each physics property in PhysicsFallingBricks
to get a feeling for the behavior that they control. Try to predict what happens in each of the following cases:
Give the floor a mass of more than
0.0f
Set the mass of bricks, or cannon balls, to a higher (
50f
) or lower value (0.5f
)Set the cannon balls' velocity to a higher (
100f
) or lower value (10f
)Move
floorGeo
a few world units higher or lower along the y axisSet the friction of bricks to a higher value using
brickPhy.setFriction(20f)
; or a lower value usingbrickPhy.setFriction(0.2f);
Set a property (such as
friction
) of a physics control before adding the control to its geometryJust for laughs – set the friction of all bricks to zero
Just for laughs – set the friction of the floor to zero
Run the code with each change and try to explain what is happening. Hint – one case causes an explosion-like impact that collapses the wall, a second one results in a NullPointerException
—and two are...