aboutsummaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2025-01-08 12:11:14 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2025-01-08 12:11:14 +0100
commitd9c67da9b8c2d8d25ef4dd2c700ddc78573d3a60 (patch)
treeb940e98ae882f1cd5d8e73a573a741f8ace3e725 /game
parent46c2cbdcbe5e7dbc4d86a5d43b3bd7275b7a1c33 (diff)
WIP
Diffstat (limited to 'game')
-rw-r--r--game/prefab/ZapperPoolScript.cpp14
1 files changed, 12 insertions, 2 deletions
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);