So when I run breakout my paddle wont move with my cursor. As soon as my mouse touches the Gwindow, I get an error in my terminal. here's my code for it, and the terminal output.

 while (lives > 0 && bricks > 0)
        GEvent event = getNextEvent (MOUSE_EVENT);

        if (event != NULL)
            if (getEventType(event) == MOUSE_MOVED)
                double x = (getX(event) - (getWidth(paddle) / 2));
                double y = (getY(paddle));
                setLocation(paddle, x, y);


jharvard@appliance (~/Dropbox/pset3/breakout): ./breakout
error: getWidth: Illegal argument type
  • i thought it may be a scope issue because when i make the (getWidth(paddle)/2 an actual number it gives the same error but for "getY" as opposed to "getWidth"
    – iluvpool19
    Mar 18, 2015 at 1:19
  • the width of the paddle and the Y of the paddle are constants. Why don't you just treat is as such?
    – gitterb
    Mar 18, 2015 at 1:34
  • 1
    OMG im an idiot. every time i find the bug i feel so stupid for not seeing it. lol. i wasnt returning the GRect correctly.
    – iluvpool19
    Mar 18, 2015 at 1:38

1 Answer 1


Solved by OP in comments:

...I wasnt returning the GRect correctly.

You must log in to answer this question.

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