From d9c67da9b8c2d8d25ef4dd2c700ddc78573d3a60 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 8 Jan 2025 12:11:14 +0100 Subject: WIP --- game/prefab/ZapperPoolScript.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'game/prefab') diff --git a/game/prefab/ZapperPoolScript.cpp b/game/prefab/ZapperPoolScript.cpp index e201149..ac6ce96 100644 --- a/game/prefab/ZapperPoolScript.cpp +++ b/game/prefab/ZapperPoolScript.cpp @@ -46,8 +46,18 @@ void ZapperPoolScript::spawn_random() { }; bool horizontal = Random::b(); - float rotation = 90.0 * horizontal; - float length = horizontal ? Random::f(400, 200) : Random::f(200, 50); + float rotation, length; + + if (horizontal) { + rotation = 90; + length = Random::f(400, 200); + } else { + rotation = 0; + length = Random::f(200, 50); + if (abs(pos.y) + length / 2 > HALLWAY_HEIGHT / 2) { + // TODO: fix offset + } + } zapper->place(pos, rotation, length); zapper->set_active(true); -- cgit v1.2.3