pub fn draw_sprite(&mut self, mut x: u8, mut y: u8, sprite: &[u8]) -> bool {
        let mut collided = false;

        for byte in sprite {
            for i in (0..8).rev() {
                x += 1;
                let bit = (byte >> i) & 0b00000001;
                if bit == 1 {
                    if self.draw_pixel(x, y) {
                        collided = true;
                    }
                }
            }
            y += 1;
            x -= 8;
        }
        collided
    }
/// Draws a list of bytes onto the screen. Each byte being one row.
/// Returns true if drawing collides with already drawn pixel.
Draws a list of bytes onto the screen. Each byte being one row.
Returns true if drawing collides with already drawn pixel.
Draws a list of bytes onto the screen . Each byte being one row . Returns true if drawing collides with already drawn pixel .
pub fn draw_sprite(&mut self, mut x: u8, mut y: u8, sprite: &[u8]) -> bool {
        let mut collided = false;
        for byte in sprite {
            for i in (0..8).rev() {
                x += 1;
                let bit = (byte >> i) & 0b00000001;
                if bit == 1 {
                    if self.draw_pixel(x, y) {
                        collided = true;
                    }
                }
            }
            y += 1;
            x -= 8;
        }
        collided
    }
pub fn draw_sprite ( & mut self , mut x : u8 , mut y : u8 , sprite : & [ u8 ] ) -> bool { let mut collided = false ; for byte in sprite { for i in ( 0 .. 8 ) . rev ( ) { x += 1 ; let bit = ( byte >> i ) & 0b00000001 ; if bit == 1 { if self . draw_pixel ( x , y ) { collided = true ; } } } y += 1 ; x -= 8 ; } collided }
Draws a list of bytes onto the screen.
Draws a list of bytes onto the screen .
&mut self
x
u8
y
u8
sprite
&[u8]
&mut self
x
u8
y
u8
sprite
&[u8]