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

Method draw

src/invaders.rs:107–118  ·  view source on GitHub ↗
(&self, frame: &mut Frame)

Source from the content-addressed store, hash-verified

105
106impl Drawable for Invaders {
107 fn draw(&self, frame: &mut Frame) {
108 for invader in self.army.iter() {
109 frame[invader.x][invader.y] = if (self.move_timer.remaining().as_secs_f32()
110 / self.move_timer.duration().as_secs_f32())
111 > 0.5
112 {
113 'x'
114 } else {
115 '+'
116 }
117 }
118 }
119}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected