Original Post
Ok, I'm working on a remake of the program called breakout for a school assignement and I'm getting this one error: \Squares.h variable or field `squareCollision' declared void The acctual function in the .h file is simple:
void squareCollision(Ball *ballPointer); and the implementation in the .cpp file is: void squareCollision(Ball *ballPointer){
for(int i = 0; i < ROW_SIZE * COLUMN_SIZE; i++)
{
if(squareExists == true){
if(ballPointer->ballX <= highX && ballPointer->ballX >= lowX)
{
if(ballPointer->ballY <= highY && ballPointer->ballY >= lowY)
{
squareExists = false;
ballPointer->ballYVelocity = -ballPointer->ballYVelocity;
ballPointer->ballXVelocity = -ballPointer->ballXVelocity;
player1_points++;
}
}
}
}
}
Now I'm trying to make the squareCollision(Ball *ballPointer) function take an object of type "Ball" and pass it to the function so I can modify/access the variables in the function. Am I doing this correctly? Also, does anyong know why I might be getting that particular error?