From 8f671745001e3f4c9ab52bc424673e833b84a6a0 Mon Sep 17 00:00:00 2001 From: "0m.ax" Date: Sat, 19 Jul 2025 02:23:33 +0200 Subject: [PATCH] grow --- src/main.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 87307df..cb2fd62 100644 --- a/src/main.rs +++ b/src/main.rs @@ -189,7 +189,11 @@ impl Drawable for Circle { /// Helper method to draw the 8 symmetric points for a given (x, y) offset. fn draw_and_move(&mut self, display: &mut Display) { - self.draw_circle(display,self.x,self.y,self.radius,255,255,255); + self.draw_circle(display,self.x,self.y,self.radius,255,255,255); + self.radius = self.radius + 1; + if self.radius > 1080/2 { + self.radius = 1; + } } } @@ -271,11 +275,11 @@ impl Display { fn main() { let mut images:Vec> = vec![ - Box::new(BouncingImage::new("images/unicorn_cc.png", 13, -10, 1, -1, -1)), - Box::new(BouncingImage::new("images/windows_logo.png", -8, 3, 2, -1, -1)), - Box::new(BouncingImage::new("images/spade.png", 32, -12, 1, 0, 0)), - Box::new(BouncingImage::new("images/dvdvideo.png", 20, 6, 5, 1000, 800)), - Box::new(BouncingImage::new("images/hackaday.png", 40, 18, 3, 500, 800)), +// Box::new(BouncingImage::new("images/unicorn_cc.png", 13, -10, 1, -1, -1)), +// Box::new(BouncingImage::new("images/windows_logo.png", -8, 3, 2, -1, -1)), +// Box::new(BouncingImage::new("images/spade.png", 32, -12, 1, 0, 0)), +// Box::new(BouncingImage::new("images/dvdvideo.png", 20, 6, 5, 1000, 800)), +// Box::new(BouncingImage::new("images/hackaday.png", 40, 18, 3, 500, 800)), Box::new(Circle::new(1920/2,1080/2,128)) ];