From 5f0c15b2d3299ea210a78d54e9b10c3cb4266139 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 19 Apr 2022 23:48:20 +0200 Subject: Created factory to handle enemy creation --- Falling.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Falling.cpp') diff --git a/Falling.cpp b/Falling.cpp index 8547ee2..deb81a4 100644 --- a/Falling.cpp +++ b/Falling.cpp @@ -6,7 +6,7 @@ Falling::Falling() : - m_speed {30} + m_speed {40} { } @@ -14,6 +14,7 @@ Falling::Falling() : void Falling::update(const float dt, Vector2& position, Generator& generator) { - (void) generator; position.y += dt * m_speed; + if (position.y > 600) + generator.toggle(false); } -- cgit v1.1