All my program work well till I lost my first ball. After that, I'm not able to start with an other one. I thought I've controlled that with my second while loop.
There the first part of my code in the complete above :
// keep playing until game over
while (lives > 0 && bricks > 0)
{
// to make the ball move
GMouseEvent click = waitForEvent(MOUSE_EVENT);
if (getEventType(click) == (MOUSE_CLICKED))
{
//declarations of variables
while (keepgoing == true)
{
and now, here the last part of my main function, where I'm supposed to going back at the beginning :
else if (getY(ball) <= 0)
{
velocity_y = -velocity_y;
}
else if (getY(ball) + getHeight(ball) >= getHeight(window))
{
velocity_y = 0;
velocity_x = 0;
lives--;
points = 0;
updateScoreboard(window, label, points);
bricks = COLS*ROWS;
keepgoing = false;
}
}
}
}
May someone can explain me why after I lost my first live, and then I click the mouse, nothing happen.
Thanks for your time.