CollideAgainstMoveSoft
Introduction
Understanding CollideAgainstMoveSoft
Code Example
void CustomActivity(bool firstTimeCalled)
{
// The higher the drag the less time the
// rectangles will spend moving when no acceleration
// is applied to them:
AxisAlignedRectangleInstance1.Drag = 3;
AxisAlignedRectangleInstance2.Drag = 3;
Keyboard keyboard = InputManager.Keyboard;
// Increase acceleration to make the rectangle movement
// more responsive, but you may also want to increase
// the drag if increasing this:
const float acceleration = 400;
keyboard.ControlPositionedObjectAcceleration(AxisAlignedRectangleInstance1, acceleration);
// Increasing this value makes the rectangles push off
// of each other more. Making this a smaller value will
// result in the rectangles pushing less and being able to
// overlap more.
const float separationValue = 25;
AxisAlignedRectangleInstance1.CollideAgainstMoveSoft(AxisAlignedRectangleInstance2,
1, 1, separationValue);
}Last updated
Was this helpful?