(&mut self, delta: Duration)
| 19 | } |
| 20 | } |
| 21 | pub fn update(&mut self, delta: Duration) { |
| 22 | self.timer.tick(delta); |
| 23 | if self.timer.finished() && !self.exploding { |
| 24 | if self.y > 0 { |
| 25 | self.y -= 1; |
| 26 | } |
| 27 | self.timer.reset(); |
| 28 | } |
| 29 | } |
| 30 | pub fn explode(&mut self) { |
| 31 | self.exploding = true; |
| 32 | self.timer = Timer::new(Duration::from_millis(250)); |