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

Method new

src/shot.rs:13–20  ·  view source on GitHub ↗
(x: usize, y: usize)

Source from the content-addressed store, hash-verified

11
12impl Shot {
13 pub fn new(x: usize, y: usize) -> Self {
14 Self {
15 x,
16 y,
17 exploding: false,
18 timer: Timer::new(Duration::from_millis(50)),
19 }
20 }
21 pub fn update(&mut self, delta: Duration) {
22 self.timer.tick(delta);
23 if self.timer.finished() && !self.exploding {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected