survivor

graphical action game for the linux terminal
git clone https://git.ce9e.org/survivor.git

commit
79f389db09b4a9793760777e2355f80d73ad4e6a
parent
476ab73434d485b8393d4a6fc31ad8de7c453937
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-03-27 06:42
add random offset to projectile position

Diffstat

M src/game.rs 5 ++++-

1 files changed, 4 insertions, 1 deletions


diff --git a/src/game.rs b/src/game.rs

@@ -224,7 +224,10 @@ impl Game {
  224   224             if weapon.last > weapon.cooldown {
  225   225                 weapon.last -= weapon.cooldown;
  226   226                 weapon.projectiles.push(weapons::Projectile {
  227    -1                     p: self.player.p,
   -1   227                     p: Pos {
   -1   228                         x: self.player.p.x + self.rng.gen_f32() * 10.0 - 5.0,
   -1   229                         y: self.player.p.y + self.rng.gen_f32() * 10.0 - 5.0,
   -1   230                     },
  228   231                     dir: match &self.player.dir {
  229   232                         Some(dir) => dir.clone(),
  230   233                         None => self.player.face,