From 5dc1a71ee3be5f72cdce0a2fdef21f4b46955557 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Wed, 8 Jan 2025 12:47:28 +0100 Subject: random better implemented --- game/enemy/EnemyScript.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'game/enemy/EnemyScript.cpp') diff --git a/game/enemy/EnemyScript.cpp b/game/enemy/EnemyScript.cpp index f9b79ea..0494bbc 100644 --- a/game/enemy/EnemyScript.cpp +++ b/game/enemy/EnemyScript.cpp @@ -15,7 +15,7 @@ using namespace std; EnemyScript::EnemyScript(){ engine.seed(rd()); this->last_fired = std::chrono::steady_clock::now(); - this->shot_delay = std::chrono::duration(3 + Random::f(0,1)); + this->shot_delay = std::chrono::duration(3 + Random::f(1,0)); } void EnemyScript::init(){ Metadata& meta = this->get_component(); @@ -52,7 +52,7 @@ void EnemyScript::fixed_update(duration_t dt) { if (elapsed > shot_delay) { this->shoot(transform.position,0); last_fired = now; - this->shot_delay = std::chrono::duration(Random::f(1,4)); + this->shot_delay = std::chrono::duration(Random::f(4,1)); } } -- cgit v1.2.3