ControlPositionedObject
Introduction
Code Example
const float magnitude = 10;
InputManager.Xbox360GamePads[0].ControlPositionedObject(MyEntity, magnitude);Implementation Details
public void ControlPositionedObject(PositionedObject positionedObject, float velocity)
{
positionedObject.XVelocity = this.LeftStick.Position.X * velocity;
positionedObject.YVelocity = this.LeftStick.Position.Y * velocity;
if (ButtonDown(Button.LeftShoulder))
positionedObject.ZVelocity = velocity;
else if (ButtonDown(Button.RightShoulder))
positionedObject.ZVelocity = -velocity;
else
positionedObject.ZVelocity = 0;
}Last updated
Was this helpful?