It's easy! Use the right and left arrow keys and don't let it touch the red line!
This was my first project with lots of additions. It gets harder as your score goes up. Try and see if you can beat my score of 35!