Skip to content

Direction Enum

rp3002 edited this page Aug 26, 2024 · 1 revision

Overview

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.

Enum: Direction

Package

package com.csse3200.game.components.minigame;

Description

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.

Enum Constants

  • 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.
Clone this wiki locally