diff options
Diffstat (limited to 'Games/Snake')
-rw-r--r-- | Games/Snake/SnakeGame.h | 3 | ||||
-rw-r--r-- | Games/Snake/main.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Games/Snake/SnakeGame.h b/Games/Snake/SnakeGame.h index 2c03e2541b..ac002158ac 100644 --- a/Games/Snake/SnakeGame.h +++ b/Games/Snake/SnakeGame.h @@ -5,13 +5,14 @@ #include <LibGUI/GWidget.h> class SnakeGame : public GWidget { + C_OBJECT(SnakeGame) public: - explicit SnakeGame(GWidget* parent = nullptr); virtual ~SnakeGame() override; void reset(); private: + explicit SnakeGame(GWidget* parent = nullptr); virtual void paint_event(GPaintEvent&) override; virtual void keydown_event(GKeyEvent&) override; virtual void timer_event(CTimerEvent&) override; diff --git a/Games/Snake/main.cpp b/Games/Snake/main.cpp index e8df14fd36..2000cc2aa4 100644 --- a/Games/Snake/main.cpp +++ b/Games/Snake/main.cpp @@ -18,7 +18,7 @@ int main(int argc, char** argv) window->set_title("Snake"); window->set_rect(100, 100, 320, 320); - auto* game = new SnakeGame; + auto game = SnakeGame::construct(); window->set_main_widget(game); auto menubar = make<GMenuBar>(); |