Hit the ball as far as you can. Your score is calculated by the total distance you have hit the ball over all your shots.
Pick your player from minor or major league. Minor league players are easier to use. Major league players are harder to control, but are more powerful and you have full control of the swing.
Minor league -- place mouse next to player's feet and when a pitch is thrown, quickly move mouse upwards to swing. How far you hit will depend on how fast you are moving when the bat makes contact with the ball. Try to hit the ball with the middle part of the bat
Major league -- Player will closely follow your cursor movements. Up and down to swing, left and right for positioning.
Try to swing as fast as possible while still under control.