Better HN
topnewbestaskshowjobs
Log inSign up

kiriin

6 karma · joined Aug 25, 2022 (4y ago) · 1 submissions

Submissions

comment 4y ago · link · parent

>std::shared_ptr<sf::RenderWindow> window; >std::shared_ptr<sf::Sprite> background, bird, pipeBottom, pipeTop;

None of that should be shared_ptr, in fact they shouldn't be pointers at all.

>auto flappy = std::make_shared<FlappyBird>(); >flappy->run();

That would work just fine as a global in main.cpp

FlappyBird flappy;