pub fn draw_pixel(&mut self, mut x: u8, mut y: u8) -> bool {
        // Loop x and y if they go out of the display's bounds.
        while x >= WIDTH as u8 {
            x -= WIDTH as u8;
        }
        while y >= HEIGHT as u8 {
            y -= HEIGHT as u8;
        }

        self.pixels[x as usize] ^= 0b10000000000000000000000000000000 >> y;

        // If the pixel is off, then it collided and this returns true.
        (self.pixels[x as usize] << y) >> HEIGHT - 1 == 0
    }
/// Draws a pixel onto the screen.
/// Returns true if drawing collides with already drawn pixel.
Draws a pixel onto the screen.
Returns true if drawing collides with already drawn pixel.
Draws a pixel onto the screen . Returns true if drawing collides with already drawn pixel .
pub fn draw_pixel(&mut self, mut x: u8, mut y: u8) -> bool {
        // Loop x and y if they go out of the display's bounds.
        while x >= WIDTH as u8 {
            x -= WIDTH as u8;
        }
        while y >= HEIGHT as u8 {
            y -= HEIGHT as u8;
        }
        self.pixels[x as usize] ^= 0b10000000000000000000000000000000 >> y;
        // If the pixel is off, then it collided and this returns true.
        (self.pixels[x as usize] << y) >> HEIGHT - 1 == 0
    }
pub fn draw_pixel ( & mut self , mut x : u8 , mut y : u8 ) -> bool { // Loop x and y if they go out of the display's bounds. while x >= WIDTH as u8 { x -= WIDTH as u8 ; } while y >= HEIGHT as u8 { y -= HEIGHT as u8 ; } self . pixels [ x as usize ] ^= 0b10000000000000000000000000000000 >> y ; // If the pixel is off, then it collided and this returns true. ( self . pixels [ x as usize ] << y ) >> HEIGHT - 1 == 0 }
Draws a pixel onto the screen.
Draws a pixel onto the screen .
&mut self
x
u8
y
u8
&mut self
x
u8
y
u8