#[derive(Clone, Copy)] pub struct Obstacle { w: f32, h: f32, // TODO replace with angle (we can have rotated colliders now) pub orientation: bool, // true means horizontal, false vertical } impl Obstacle { pub fn new(orientation: bool) -> Obstacle { Obstacle { w: 200.0, h: 20.0, orientation: orientation, } } pub fn width(&self) -> f32 { if self.orientation { self.w } else { self.h } } pub fn height(&self) -> f32 { if self.orientation { self.h } else { self.w } } }