Improvements
This commit is contained in:
parent
93171a5123
commit
a00e39e3f5
|
@ -108,9 +108,11 @@ impl Renderer {
|
|||
}
|
||||
|
||||
for c in scene.characters() {
|
||||
if c.is_alive() {
|
||||
self.draw(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Triggers the display.
|
||||
pub fn display(&mut self) {
|
||||
|
|
|
@ -89,6 +89,10 @@ impl Scene {
|
|||
let mut state = State::Finished;
|
||||
|
||||
for c in &mut self.characters {
|
||||
|
||||
// Don't need to update if the character is dead
|
||||
if c.is_alive() {
|
||||
|
||||
let old = c.bbox();
|
||||
|
||||
// Compute the offset between position and bbox
|
||||
|
@ -112,9 +116,12 @@ impl Scene {
|
|||
c.fall_off();
|
||||
}
|
||||
|
||||
if c.controls().is_some() && c.is_alive() {
|
||||
// If a character is alive and still have controls, the game should continue
|
||||
if c.controls().is_some() {
|
||||
state = State::Running;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
state
|
||||
|
|
Loading…
Reference in New Issue