pub struct Ball { /* private fields */ }Expand description
The ball
Implementations§
Source§impl Ball
impl Ball
Sourcepub fn new(position: Position, game_dimensions: Dimensions, power: u16) -> Ball
pub fn new(position: Position, game_dimensions: Dimensions, power: u16) -> Ball
Create a new ball
The power of a ball is the amount of damage it does to blocks when it collides
Sourcepub fn update_dimensions(&mut self, dimensions: Dimensions)
pub fn update_dimensions(&mut self, dimensions: Dimensions)
Update the game dimensions, this moves the ball back into view if it wouldn’t be in the new dimensions
Auto Trait Implementations§
impl Freeze for Ball
impl RefUnwindSafe for Ball
impl Send for Ball
impl Sync for Ball
impl Unpin for Ball
impl UnwindSafe for Ball
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more