From ed8f12e179b6b777d26d65abd1b247429396bac9 Mon Sep 17 00:00:00 2001 From: "0m.ax" Date: Sat, 19 Jul 2025 01:40:48 +0200 Subject: [PATCH] move drawpn to main thing --- src/main.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index f27aa71..d00d10e 100644 --- a/src/main.rs +++ b/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);