pub fn draw_game_over(&self, args: RenderArgs) {
        let mut gl = GlGraphics::new(OpenGL::V3_2);
        let font = include_bytes!("../assets/FiraSans-Regular.ttf");
        let mut glyphs = GlyphCache::from_bytes(font, (), TextureSettings::new()).unwrap();

        gl.draw(args.viewport(), |c, g| {
            clear(Color::BACKGROUND, g);
            text(
                Color::TEXT,
                (self.window_size.width / 13.3) as u32,
                format!("Final Length: {}", self.snake.length).as_str(),
                &mut glyphs,
                c.transform
                    .trans(self.window_size.width / 4.0, self.window_size.height / 2.0),
                g,
            )
        })
        .expect("Failed to make end screen");
    }
// draw the game over screen and show the final length of the snake
draw the game over screen and show the final length of the snake
draw the game over screen and show the final length of the snake
pub fn draw_game_over(&self, args: RenderArgs) {
        let mut gl = GlGraphics::new(OpenGL::V3_2);
        let font = include_bytes!("../assets/FiraSans-Regular.ttf");
        let mut glyphs = GlyphCache::from_bytes(font, (), TextureSettings::new()).unwrap();
        gl.draw(args.viewport(), |c, g| {
            clear(Color::BACKGROUND, g);
            text(
                Color::TEXT,
                (self.window_size.width / 13.3) as u32,
                format!("Final Length: {}", self.snake.length).as_str(),
                &mut glyphs,
                c.transform
                    .trans(self.window_size.width / 4.0, self.window_size.height / 2.0),
                g,
            )
        })
        .expect("Failed to make end screen");
    }
pub fn draw_game_over ( & self , args : RenderArgs ) { let mut gl = GlGraphics :: new ( OpenGL :: V3_2 ) ; let font = include_bytes ! ( " " ) ; let mut glyphs = GlyphCache :: from_bytes ( font , ( ) , TextureSettings :: new ( ) ) . unwrap ( ) ; gl . draw ( args . viewport ( ) , | c , g | { clear ( Color :: BACKGROUND , g ) ; text ( Color :: TEXT , ( self . window_size . width / 13.3 ) as u32 , format ! ( " " self snake length ) . as_str ( ) , & mut glyphs , c . transform . trans ( self . window_size . width / 4.0 , self . window_size . height / 2.0 ) , g , ) } ) . expect ( " " ) ; }
draw the game over screen and show the final length of the snake
draw the game over screen and show the final length of the snake
&self
args
RenderArgs
&self
args
RenderArgs