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

Method draw

src/level.rs:29–38  ·  view source on GitHub ↗
(&self, frame: &mut Frame)

Source from the content-addressed store, hash-verified

27
28impl Drawable for Level {
29 fn draw(&self, frame: &mut Frame) {
30 // format our level string
31 let formatted = format!("LEVEL: {:0>2}", self.level);
32
33 // iterate over all characters
34 for (i, c) in formatted.chars().enumerate() {
35 // put them in the first row
36 frame[i + 20][0] = c;
37 }
38 }
39}
40
41#[cfg(test)]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected