Animation
This commit is contained in:
@@ -76,12 +76,16 @@ Scene::getObjects( const std::unordered_set< int > &objectIDs ) {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
void Scene::movement() {
|
||||
void Scene::updateScene() {
|
||||
// check for objects that should be removed
|
||||
checkKilled();
|
||||
std::lock_guard< std::mutex > lock( render_mutex );
|
||||
int now_ticks = SDL_GetTicks();
|
||||
for ( const auto &x : render_objects ) {
|
||||
// move objects that should be moved
|
||||
x->move( now_ticks - prev_ticks );
|
||||
// animate objects that should be animated
|
||||
x->animate( now_ticks - prev_ticks );
|
||||
}
|
||||
prev_ticks = now_ticks;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user