summaryrefslogtreecommitdiff
path: root/server/src/entity/mod.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-06-03 21:37:38 +0200
committermetamuffin <metamuffin@disroot.org>2025-06-03 21:37:38 +0200
commit29772d6b2f244c6c172347c5e96530a16ca4517d (patch)
treed0efbf6d035a5b8ca07f0b87abebd6097ccc7181 /server/src/entity/mod.rs
parent5acdf0a7ae6fcf92d399d9023da07240e7870fef (diff)
downloadhurrycurry-29772d6b2f244c6c172347c5e96530a16ca4517d.tar
hurrycurry-29772d6b2f244c6c172347c5e96530a16ca4517d.tar.bz2
hurrycurry-29772d6b2f244c6c172347c5e96530a16ca4517d.tar.zst
pedestrian speed config
Diffstat (limited to 'server/src/entity/mod.rs')
-rw-r--r--server/src/entity/mod.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/src/entity/mod.rs b/server/src/entity/mod.rs
index 2eadc0ff..6d69436d 100644
--- a/server/src/entity/mod.rs
+++ b/server/src/entity/mod.rs
@@ -150,7 +150,8 @@ pub enum EntityDecl {
Book,
Pedestrians {
spawn_delay: f32,
- spawn_delay_stdev: f32,
+ spawn_delay_stdev: Option<f32>,
+ speed: Option<f32>,
points: Vec<Vec2>,
},
}
@@ -240,11 +241,17 @@ pub fn construct_entity(
spawn_delay,
spawn_delay_stdev,
points,
+ speed,
} => Box::new(Pedestrians {
players: HashMap::new(),
points,
- spawn_delay_distr: rand_distr::Normal::new(spawn_delay, spawn_delay_stdev).unwrap(),
+ spawn_delay_distr: rand_distr::Normal::new(
+ spawn_delay,
+ spawn_delay_stdev.unwrap_or(0.),
+ )
+ .unwrap(),
cooldown: 0.,
+ speed: speed.unwrap_or(0.6),
}),
})
}