move drawpn to main thing
This commit is contained in:
parent
ca1a207c99
commit
ed8f12e179
1 changed files with 7 additions and 8 deletions
15
src/main.rs
15
src/main.rs
|
@ -56,7 +56,6 @@ trait Drawable {
|
|||
fn rate(&self) -> u32;
|
||||
fn draw_and_move(&mut self, display: &mut Display);
|
||||
|
||||
fn draw_png(&mut self, display: &mut Display, x: i32, y: i32);
|
||||
}
|
||||
impl BouncingImage {
|
||||
/// Initializes a new BouncingImage.
|
||||
|
@ -84,13 +83,6 @@ impl BouncingImage {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
impl Drawable for BouncingImage {
|
||||
fn rate(&self) -> u32 {
|
||||
return self.rate;
|
||||
}
|
||||
/// Draws a PNG image at the given coordinates.
|
||||
fn draw_png(&mut self, display: &mut Display, x: i32, y: i32) {
|
||||
|
||||
|
@ -103,7 +95,14 @@ impl Drawable for BouncingImage {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
impl Drawable for BouncingImage {
|
||||
fn rate(&self) -> u32 {
|
||||
return self.rate;
|
||||
}
|
||||
|
||||
/// Draws the image and updates its position.
|
||||
fn draw_and_move(&mut self, display: &mut Display) {
|
||||
self.draw_png(display, self.x, self.y);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue