..*self
}));
}
- // let x = (self.pos.x / lvl.grid.cell_size.width as f64).min(lvl.grid.size.width as f64 - 1.0).max(0.0) as usize;
- // let y = (self.pos.y / lvl.grid.cell_size.height as f64).min(lvl.grid.size.height as f64 - 1.0).max(0.0) as usize;
- // if lvl.grid.cells[x][y] {
- // if self.bounces == 0 {
- // return Dead
- // }
- // self.vel *= -0.25;
- // self.pos += self.vel;
- // self.bounces -= 1;
- // use rand::distributions::{Distribution, Normal};
- // let mut rng = rand::thread_rng();
- // let a = Radians(self.vel.to_radians().0 + Normal::new(0.0, 0.75).sample(&mut rng));
- // objects.push(Box::new(Boll {
- // vel: Point::from(a) * Normal::new(1.0, 0.25).sample(&mut rng) * self.vel.length(),
- // ..*self
- // }));
- // }
Alive
}