Skip to content
Snippets Groups Projects
Commit bbe3b764 authored by PEREUIL THOMAS's avatar PEREUIL THOMAS
Browse files

update

parent 5cc30fbe
Branches
No related merge requests found
......@@ -28,7 +28,7 @@
*
* @param balls list of all the balls currently in the playing frame
*
* @param endValue indicate how the game ended
* @param endValue indicate how the game ended (True : win, False : loose)
**/
class Game
{
......@@ -77,6 +77,8 @@ class Game
bool collisionCheck();
void loop();
bool update(int elapsedTime);
};
#endif
\ No newline at end of file
......@@ -161,4 +161,21 @@ void Game::loop()
}
time = timeNew;
}
}
bool Game::update(int elapsedTime)
{
for (auto baIt = this->balls.begin(); baIt != this->balls.end(); baIt++)
{
std::shared_ptr<Ball> b = *baIt;
if (b != nullptr)
{
b->move(elapsedTime/10e6);
}
}
if (this->collisionCheck())
{
return true;
}
return false;
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment