private void drawPlayer(WorldObject world)
{
float rotationAngle;
Vector2 origin;
//spriteBatch.Draw(Texture, Position, Color.White);
int difference = world.getPositionDifference();
if (difference > 0)
{
// decel - bring to min
rotationAngle = Constants.ROTATION_ANGLE_DOWN;
origin = new Vector2(0, 0);
}
else if (world.player.airtime > 14)
{
// accel - bring to max
rotationAngle = Constants.ROTATION_ANGLE_UP;
origin = new Vector2(100, 10);
}
else
{
// flat - bring to normal speed
rotationAngle = Constants.ROTATION_ANGLE_NORMAL;
origin = new Vector2(40, -10);
}
spriteBatch.Draw(world.player.Texture, world.player.Position, null, Color.White, rotationAngle, origin, 1f, SpriteEffects.None, 0);
}