Skip to content

Commit 94e7030

Browse files
Player falls from the sky. Yeah bad ideas ++
1 parent 2858ad3 commit 94e7030

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/components/player.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ impl Player {
110110
self.velocity += self.gravity;
111111
self.pos_y -= self.velocity;
112112
}
113+
114+
if self.pos_y < 0. && !gonna_boom {
115+
self.pos_y = 0.;
116+
}
113117
}
114118

115119
pub fn shoot(&mut self) -> Option<Turbofish> {

src/game.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ impl Game {
147147
}
148148
}
149149

150-
let player = player.expect("No player found!");
150+
let mut player = player.expect("No player found!");
151+
152+
player.pos_y += 40.;
151153

152154
camera.move_to(Vec2::new(player.pos_x, player.pos_y));
153155

0 commit comments

Comments
 (0)