Class SnakeRenderer

java.lang.Object
com.csse3200.game.minigames.snake.rendering.SnakeRenderer
All Implemented Interfaces:
MinigameRenderable

public class SnakeRenderer extends Object implements MinigameRenderable
Renders the snake and its segments on the grid in the Snake mini-game.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SnakeRenderer(Snake snake, SnakeGrid grid, com.badlogic.gdx.graphics.Texture snakeTexture, com.badlogic.gdx.graphics.Texture snakeBodyVerticalTexture, com.badlogic.gdx.graphics.Texture snakeBodyBentTexture, com.badlogic.gdx.graphics.Texture snakeTailTexture, MinigameRenderer renderer)
    Creates a new SnakeRenderer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Renders the snake, including its head and body segments, with appropriate rotation.

    Methods inherited from class java.lang.Object

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

    • SnakeRenderer

      public SnakeRenderer(Snake snake, SnakeGrid grid, com.badlogic.gdx.graphics.Texture snakeTexture, com.badlogic.gdx.graphics.Texture snakeBodyVerticalTexture, com.badlogic.gdx.graphics.Texture snakeBodyBentTexture, com.badlogic.gdx.graphics.Texture snakeTailTexture, MinigameRenderer renderer)
      Creates a new SnakeRenderer.
      Parameters:
      snake - The snake to render.
      grid - The grid the snake is on.
      snakeTexture - The texture for the snake's head.
      snakeBodyVerticalTexture - The texture for the snake's vertical body segments.
      snakeBodyBentTexture - The texture for the snake's bent body segments.
      renderer - The renderer used for drawing.
  • Method Details

    • render

      public void render()
      Renders the snake, including its head and body segments, with appropriate rotation.
      Specified by:
      render in interface MinigameRenderable