X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fmain.rs;h=d99da89c7aacec815ddda96bf9bcac042bab306c;hb=6c5dd5cf7007081ce7ea87e59aac21c0e7007a2c;hp=0cb2ecfadb754f30b6dff5007a20643f596246c1;hpb=c315bb317cbd779063cb0135abe731886de30838;p=kaka%2Frust-sdl-test.git diff --git a/src/main.rs b/src/main.rs index 0cb2ecf..d99da89 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,7 @@ use sdl2::video::Window; use sdl2::video::WindowContext; use time::PreciseTime; -use boll::{Boll, SquareBoll}; +use boll::{Boll, SquareBoll, CircleBoll}; use common::Point2D; #[macro_use] mod common; @@ -125,10 +125,12 @@ fn main() { } Event::KeyDown { keycode: Some(Keycode::KpPlus), .. } => { boll_size = std::cmp::min(boll_size + 1, 32) } Event::KeyDown { keycode: Some(Keycode::KpMinus), .. } => { boll_size = std::cmp::max(boll_size - 1, 1) } - Event::MouseMotion { x, y, .. } => { bolls.push(Box::new(SquareBoll { - pos: point!(x as f64, y as f64), - vel: point!(0.0, 0.0), - })) } + Event::MouseMotion { x, y, .. } => { + bolls.push(Box::new(CircleBoll::new( + point!(x as f64, y as f64), + point!(0.0, 0.0), + ))) + } _ => {} } }