update todo list, print real time taken when level is completed

This commit is contained in:
Crispy 2024-12-08 12:10:14 +01:00
parent 78027aaaa0
commit dc9411cf9d
2 changed files with 18 additions and 13 deletions

View file

@ -4,19 +4,20 @@
logic mostly like https://git.crispypin.cc/CrispyPin/marble logic mostly like https://git.crispypin.cc/CrispyPin/marble
## todo ## todo
(more levels) - copy/cut/paste selections
story/lore - undo/redo
copy/cut/paste selections - more levels
timestamps in solutions and blueprints - make marble movement symmetric and order-independent
multiple input/output sets - make power propagation not recursive
undo/redo - story/lore
tooltips - timestamps in solutions and blueprints
show level info in editor - multiple input/output sets
lock tile types for early levels to make it less overwhelming - tooltips
display tool variant more clearly (it's not obvious there are more states) - show level info in editor
make marble movement more consistent (`>o o<` depends on internal marble order) - lock tile types for early levels to make it less overwhelming
decide on marble data size (u32 or byte?) - display tool variant more clearly (it's not obvious there are more states)
blueprint rotation? - option to use 8-bit marbles?
- blueprint rotation?
## file hierarchy ## file hierarchy
``` ```

View file

@ -64,6 +64,7 @@ pub struct Editor {
blueprint_scroll: usize, blueprint_scroll: usize,
step_time: u128, step_time: u128,
max_step_time:u128, max_step_time:u128,
start_time: Instant
} }
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
@ -141,6 +142,7 @@ impl Editor {
blueprint_scroll: 0, blueprint_scroll: 0,
step_time: 0, step_time: 0,
max_step_time: 0, max_step_time: 0,
start_time: Instant::now(),
} }
} }
@ -166,6 +168,7 @@ impl Editor {
fn start_sim(&mut self) { fn start_sim(&mut self) {
self.max_step_time = 0; self.max_step_time = 0;
self.start_time = Instant::now();
self.machine.reset(); self.machine.reset();
self.machine.set_board(self.source_board.clone()); self.machine.set_board(self.source_board.clone());
} }
@ -193,6 +196,7 @@ impl Editor {
&& self.complete_popup == Popup::Start && self.complete_popup == Popup::Start
{ {
self.complete_popup = Popup::Visible; self.complete_popup = Popup::Visible;
println!("completed in {:?}", self.start_time.elapsed());
self.exit_state = ExitState::Save; self.exit_state = ExitState::Save;
self.sim_state = SimState::Stepping; self.sim_state = SimState::Stepping;
self.score = Some(Score { self.score = Some(Score {