Commit cf64a490 authored by Astro's avatar Astro
Browse files

time fixes

parent f028adfd
......@@ -6,6 +6,7 @@ pub trait Time {
fn set_time(&self);
}
#[derive(Clone, Copy, Debug)]
pub struct Seconds(pub u32);
impl From<MilliSeconds> for Seconds {
......@@ -31,6 +32,7 @@ impl Sub for Seconds {
}
}
#[derive(Clone, Copy, Debug)]
pub struct MilliSeconds(pub u64);
impl From<Seconds> for MilliSeconds {
......
......@@ -188,7 +188,7 @@ fn game(level: u16, mut score: u32) -> GameResult {
exit(0);
}
let mut check_finish = false;
let speed_steps = 2 + (Seconds::time() - start_time) / 15;
let speed_steps = 2 + (Seconds::time() - start_time).0 / 15;
let speed_steps = (speed_steps >> 1) +
(speed_steps & tick & 1);
for _ in 0..speed_steps {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment