(&mut self)
| 31 | } |
| 32 | } |
| 33 | pub fn shoot(&mut self) -> bool { |
| 34 | if self.shots.len() < 2 { |
| 35 | self.shots.push(Shot::new(self.x, self.y - 1)); |
| 36 | true |
| 37 | } else { |
| 38 | false |
| 39 | } |
| 40 | } |
| 41 | pub fn update(&mut self, delta: Duration) { |
| 42 | for shot in self.shots.iter_mut() { |
| 43 | shot.update(delta); |