Skip to content
Snippets Groups Projects
Commit a73a4876 authored by pumapaul's avatar pumapaul
Browse files

Use combat log enum for waiting

parent a5175c1e
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ use std::cmp::{min, max};
use rand::{thread_rng, Rng};
use tetra::graphics::text::{VectorFontBuilder, Font, Text};
use crate::game_state::combat_log::PlayerAction;
use crate::game_state::combat_log::PlayerAction::Move;
use crate::game_state::combat_log::PlayerAction::{Move, Wait};
use crate::game_state::level::Level;
type Point = (usize, usize);
......@@ -99,11 +99,16 @@ impl GameState {
Key::N => !is_player_alive && self.create_new_run(),
Key::W | Key::A | Key::S | Key::D | Key::Down | Key::Up | Key::Right | Key::Left =>
is_player_alive && self.handle_user_movement(key),
Key::Space => is_player_alive,
Key::Space => is_player_alive && self.do_wait(),
_ => false
};
}
fn do_wait(&mut self) -> bool {
self.current_run.combat_log.player_action = Option::from(Wait);
true
}
fn create_new_run(&mut self) -> bool {
self.current_run = Run::new();
false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment