Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub struct Rain<'a>{
- pub blobs: Vec<Blob>,
- ctx: &'a Context
- }
- impl Rain<'_>{
- fn new(ctx: &mut Context, maxCount: isize)->Rain{
- Rain {
- blobs: (1..maxCount).map(|_x| Blob::new()).collect::<Vec<Blob>>(),
- ctx
- }
- }
- fn draw(&mut self){
- for blob in &self.blobs {
- let circle = graphics::Mesh::new_circle(
- self.ctx,
- graphics::DrawMode::fill(),
- na::Point2::new(blob.position.x, blob.position.y),
- blob.radius,
- 0.1,
- graphics::WHITE,
- );
- // graphics::draw(ctx, &circle, (na::Point2::new(pool.position.x, pool.position.y),))?;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement