Monsters can attack player now
This commit is contained in:
@@ -43,8 +43,6 @@ impl Game {
|
||||
g
|
||||
}
|
||||
|
||||
/// returns true if the player is dead (life <= 0)
|
||||
fn player_is_dead(&self) -> bool { self.get_player().get_life() <= 0 }
|
||||
/// returns true if the player is standing on the End element
|
||||
fn player_reached_goal(&mut self) -> bool {
|
||||
match self.next_element(0, 0) {
|
||||
@@ -60,7 +58,7 @@ impl Game {
|
||||
}
|
||||
/// returns the state of the game (depending on player's life and position)
|
||||
pub fn get_game_state(&mut self) -> GameState {
|
||||
if self.player_is_dead() {
|
||||
if self.player.is_dead() {
|
||||
return GameState::LOST;
|
||||
}
|
||||
if self.player_reached_goal() {
|
||||
|
||||
Reference in New Issue
Block a user