diff --git a/src/main.rs b/src/main.rs index 3c80352..e2522a5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,10 +21,17 @@ fn model(app: &App) -> Model { .build() .unwrap(); - Model { - _window, - particles: Vec::new(), + let boundary = app.window_rect(); + let mut particles = Vec::new(); + + for _ in 0..100 { + let x = random_range(boundary.left(), boundary.right()); + let y = random_range(boundary.top(), boundary.bottom()); + let particle = Particle::new(Vec2::new(x, y)); + particles.push(particle); } + + Model { _window, particles } } // Handle events related to the window and update the model if necessary