Class SnakeGameRenderer

java.lang.Object
com.csse3200.game.minigames.snake.rendering.SnakeGameRenderer

public class SnakeGameRenderer extends Object
Renders all elements of the Snake mini-game, including the grid, apple, snake, and scoreboard.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initialises the SnakeGameRenderer and its sub-renderers.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Disposes of resources used by the renderer, including textures and the SpriteBatch.
    void
    render(int score)
    Renders the entire snake game including grid, apple, snake, and scoreboard.
    void
    resize(int width, int height)
    Resizes the screen

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SnakeGameRenderer

      public SnakeGameRenderer(SnakeGame game)
      Initialises the SnakeGameRenderer and its sub-renderers.
      Parameters:
      game - The SnakeGame instance containing game state and logic.
  • Method Details

    • render

      public void render(int score)
      Renders the entire snake game including grid, apple, snake, and scoreboard.
      Parameters:
      score - The current score to be displayed on the scoreboard.
    • resize

      public void resize(int width, int height)
      Resizes the screen
      Parameters:
      width - width of the screen
      height - height of the screen
    • dispose

      public void dispose()
      Disposes of resources used by the renderer, including textures and the SpriteBatch.