Skip to content

Commit

Permalink
Fix bug in lives #23 #20 #15
Browse files Browse the repository at this point in the history
  • Loading branch information
jjfiv committed Sep 25, 2018
1 parent 6c0f712 commit 8fe30fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion toybox/src/amidar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ impl super::State for State {
screen::GAME_SIZE.0,
screen::GAME_SIZE.1,
));
if self.lives <= 0 {
if self.lives < 0 {
return output;
}

Expand Down
4 changes: 2 additions & 2 deletions toybox/src/breakout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ impl super::State for State {
screen::FRAME_RIGHT_SUPPORT.1,
));

if self.lives <= 0 {
if self.lives < 0 {
return output;
}

Expand Down Expand Up @@ -515,4 +515,4 @@ mod tests {
assert_eq!(uniq_grays.len(), num_colors);
}

}
}
2 changes: 1 addition & 1 deletion toybox/src/space_invaders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl super::State for State {
screen::GAME_SIZE.1 - screen::SKY_TO_GROUND,
));

if self.lives() <= 0 {
if self.lives() < 0 {
return output;
}

Expand Down

0 comments on commit 8fe30fb

Please sign in to comment.