-
Notifications
You must be signed in to change notification settings - Fork 1
Direction Enum
rp3002 edited this page Aug 26, 2024
·
1 revision
The Direction
enum is an essential component for the Snake mini-game which defines the possible directions in which the snake can move within the game grid.
package com.csse3200.game.components.minigame;
The Direction
enum defines four directions (right, left, up, and down) in which the snake can move in, and a ZERO
state, which represents a stationary or an initial state.
-
RIGHT
- Represents movement to the right along the x-axis, increasing the x-coordinate.
-
LEFT
- Represents movement to the left along the x-axis, decreasing the x-coordinate.
-
UP
- Represents movement upward along the y-axis, increasing the y-coordinate.
-
DOWN
- Represents movement downward along the y-axis, decreasing the y-coordinate.
-
ZERO
- Represents a stationary state, where no movement occurs. Used as a default state before movement begins.