This commit is contained in:
0m.ax 2025-07-19 02:23:33 +02:00
parent eb6207e119
commit 8f67174500

View file

@ -190,6 +190,10 @@ 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.radius = self.radius + 1;
if self.radius > 1080/2 {
self.radius = 1;
}
}
}
@ -271,11 +275,11 @@ impl Display {
fn main() {
let mut images:Vec<Box<dyn Drawable>> = 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))
];