MCPcopy Create free account
hub / github.com/CleanCut/invaders / shoot

Method shoot

src/player.rs:33–40  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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);

Callers 1

mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected