Skip to main content
added 21 characters in body; edited title
Source Link
kzidane
  • 17.7k
  • 3
  • 28
  • 100

ball disappears Why Does the Ball Disappear After Calling move()?

Code runs perfectly when the initialization functions are called:. I get the bricks, the ball,and and the paddle, which moves with mouse. However, when program runs move(ball, velocity, vertical),calls

move(ball, velocity, vertical);

where velocity = 2velocity = 2 and vertical = 4vertical = 4, the ball disappears from the window. I have tried the syntax in the documentation (i.e. gobject->move(dx, dy)gobject -> move(dx, dy)) but compiler didn't like that. GDB is no help either, tried running getX()getX() to see where ball was, but there was no ball in context. I suppose I could write my own move function, but am wondering why this method makes my ball disappear.

ball disappears

Code runs perfectly when the initialization functions are called: I get the bricks, the ball,and the paddle, which moves with mouse. However, when program runs move(ball, velocity, vertical), where velocity = 2 and vertical = 4, the ball disappears from the window. I have tried the syntax in the documentation (i.e. gobject->move(dx, dy)) but compiler didn't like that. GDB is no help either, tried running getX() to see where ball was, but there was no ball in context. I suppose I could write my own move function, but am wondering why this method makes my ball disappear.

Why Does the Ball Disappear After Calling move()?

Code runs perfectly when the initialization functions are called. I get the bricks, the ball and the paddle which moves with mouse. However, when program calls

move(ball, velocity, vertical);

where velocity = 2 and vertical = 4, the ball disappears from the window. I have tried the syntax in the documentation (i.e. gobject -> move(dx, dy)) but compiler didn't like that. GDB is no help either, tried running getX() to see where ball was, but there was no ball in context. I suppose I could write my own move function, but am wondering why this method makes my ball disappear.

Source Link
ronga
  • 1.4k
  • 1
  • 8
  • 15

ball disappears

Code runs perfectly when the initialization functions are called: I get the bricks, the ball,and the paddle, which moves with mouse. However, when program runs move(ball, velocity, vertical), where velocity = 2 and vertical = 4, the ball disappears from the window. I have tried the syntax in the documentation (i.e. gobject->move(dx, dy)) but compiler didn't like that. GDB is no help either, tried running getX() to see where ball was, but there was no ball in context. I suppose I could write my own move function, but am wondering why this method makes my ball disappear.