Add coin animation

This commit is contained in:
2021-07-24 20:50:24 +02:00
parent 130a01feda
commit e67cf508a2
12 changed files with 89 additions and 14 deletions
+5
View File
@@ -142,6 +142,11 @@ void doInput( std::shared_ptr< SDLPP::Scene > scene ) {
coin_count++;
coins->changeText(std::to_string(coin_count) + " COINS");
}
if ( mv.hasCoinBlock() ) {
auto coin = mv.getCoinBlock();
scene->addObject(coin);
scene->setZIndex(coin, 1);
}
// if player is > 0.7 of playground, move everything left
auto playerX = mario->getRect().x;