Commit 9d4d2b81 authored by Rahix's avatar Rahix 🦀
Browse files

clock: Also update clock in heaven and level_loading states

For proper operation of the clock, it needs to be updated in those
states as well.
parent 7cd65f4e
...@@ -77,7 +77,12 @@ impl gamestate::State for HeavenState { ...@@ -77,7 +77,12 @@ impl gamestate::State for HeavenState {
.unwrap(); .unwrap();
} }
fn update(&mut self, _timestamp: f64) -> gamestate::Transition { fn update(&mut self, timestamp: f64) -> gamestate::Transition {
self.resources
.get_mut::<resources::Clock>()
.unwrap()
.update(timestamp);
{ {
let rendering = self.resources.get_mut::<resources::Rendering>().unwrap(); let rendering = self.resources.get_mut::<resources::Rendering>().unwrap();
rendering.set_fill_style(&colors::BACKGROUND); rendering.set_fill_style(&colors::BACKGROUND);
......
...@@ -72,7 +72,12 @@ impl gamestate::State for LevelLoadingState { ...@@ -72,7 +72,12 @@ impl gamestate::State for LevelLoadingState {
gamestate::Transition::Loop gamestate::Transition::Loop
} }
fn update(&mut self, _timestamp: f64) -> gamestate::Transition { fn update(&mut self, timestamp: f64) -> gamestate::Transition {
self.resources
.get_mut::<resources::Clock>()
.unwrap()
.update(timestamp);
{ {
let rendering = self.resources.get_mut::<resources::Rendering>().unwrap(); let rendering = self.resources.get_mut::<resources::Rendering>().unwrap();
rendering.set_fill_style(&colors::BACKGROUND); rendering.set_fill_style(&colors::BACKGROUND);
......
Markdown is supported
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