grow
This commit is contained in:
parent
eb6207e119
commit
8f67174500
1 changed files with 10 additions and 6 deletions
14
src/main.rs
14
src/main.rs
|
@ -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))
|
||||
];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue