Your score is calculated by looking at your acceleration and braking over each trip. Each time the ray changes from the healthy blue colour to purple or red, it counts against you, so the longer you can keep the ray blue during your drive, the higher the score will be.