What's the best solution for providing proper parameters (x,y) for move() function? "Move() function" we use it to move the ball in the Breakout game.


Move is a pre-defined function in the SPL. It requires 3 parameters: a type GObject (something to move) and a dx parameter (an x plane displacement) and a dy parameter (a y plane displacement).

Read up on the SPL Objects and Functions here, and re-watch the walkthrough videos presented by David relating to "bounce". The pset specification has a numbered item delving into making the ball move, complete with how to utilize the drand48 function to randomize initial movement of the ball; you should re-read that section as well.


Like KernelRutgers said, you'll definitely want to utilize move().

On a second note, you should take a look at bounce.c in src4m, it utilizes move() as well, except that it only uses an x displacement.

In breakout, you will need to use both an x displacement, and a y displacement.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .