Hi, I keep getting the error message "error C2143: syntax error : missing ';' before '.'" I am making a game of pong and honestly have no idea what could be causing this. The code is over 2 .cpp files and 1 .h file (including the main.cpp)
The Ball function is also in a class named Ball.
Calling the function in main.cpp.
Ball.Ball_Paddle_hit();
Declaring the function in the header. (.h file)
void Ball_Paddle_hit();
Defining the code in the .cpp.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
void Ball::check_win(int p1score, int p2score)
{
if (p1score == 5)
{
cout << "P1 wins.";
game_stop();
}
if (p2score == 5)
{
cout << "P2 wins.";
game_stop();
}
}