Class SnakeRenderer
java.lang.Object
com.csse3200.game.minigames.snake.rendering.SnakeRenderer
- All Implemented Interfaces:
MinigameRenderable
Renders the snake and its segments on the grid in the Snake mini-game.
-
Constructor Summary
ConstructorsConstructorDescriptionSnakeRenderer
(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 TypeMethodDescriptionvoid
render()
Renders the snake, including its head and body segments, with appropriate rotation.
-
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 interfaceMinigameRenderable
-