Ping Pong game with LED's

Guys i have been asked to write code for a ping pong game on pic18f8722 in c (program: mplap ide). Any pointers because i'm inexperienced in writing code. Basically you have to press the button at the right time for led's to move back in opposite direction.

I would grab some tutorial or book on programming PIC controllers to start.  C is fairly straight forward and what you would be doing with LEDs should also be pretty easy.  My guess is you have an array of LEDs and need to display a ball and two bumpers.  The easiest way for a beginner is to use an array in code of the same size as your physical array.  You use these as your scene and when you want to display the game scene at a moment in time you loop through the array and turn on the LEDs.  Between printing your scene you check for user inputs such as button presses to move their bumpers up or down and update the position of your ball.

 

In all honesty this is not simple for someone who does not know the basics.  When I took programming 101 in college this was one of the last things we learned in C because to do it efficiently you need to have an understanding of the basic C elements.