Skip to content

Commit

Permalink
fix infintie shot bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lislis committed Jul 7, 2017
1 parent f33ae70 commit e2c2368
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "manzana-attack"
version = "1.0.0"
version = "1.1.0"
authors = ["lislis <mail@lislis.de>"]

[[bin]]
Expand Down
7 changes: 5 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@ impl Player {
let y = self.y as f64;
let x = self.calc_coord(x);
let y = self.calc_coord(y);
self.shots.fire();
self.apples.push(Apple::new(x, y));
println!("{}", self.shots.left);
if self.shots.left > 0 {
self.shots.fire();
self.apples.push(Apple::new(x, y));
}
}
pub fn update(&mut self) {
for a in self.apples.iter_mut() {
Expand Down

0 comments on commit e2c2368

Please sign in to comment.