Serialized Form

  • Package com.project.snakeGame

    • Class com.project.snakeGame.GamePanel

      class GamePanel extends JPanel implements Serializable
      • Serialized Fields

        • applesEaten
          int applesEaten
          Score - number of apples eaten.
        • appleX
          int appleX
          X and Y positions of the apple.
        • appleY
          int appleY
          X and Y positions of the apple.
        • bodyParts
          int bodyParts
          Initial length of the snake.
        • direction
          char direction
          Current direction of the snake's movement.
        • isRunning
          boolean isRunning
          Game running state.
        • random
          Random random
          Random number generator for apple positioning.
        • timer
          Timer timer
          Timer to control the game speed and refresh rate.
        • x
          int[] x
          Arrays storing the snake's X and Y coordinates.
        • y
          int[] y
    • Class com.project.snakeGame.HomePanel

      class HomePanel extends JPanel implements Serializable
      • Serialized Fields

        • cardLayout
          CardLayout cardLayout
          The layout manager that handles panel switching.
        • easyMode
          JButton easyMode
          Button for starting the game in Easy mode.
        • exitGame
          JButton exitGame
          Button for exiting the game.
        • hardMode
          JButton hardMode
          Button for starting the game in Hard mode.
        • mainMenu
          JPanel mainMenu
          The main menu panel that holds the buttons and title.
    • Class com.project.snakeGame.SnakeGame

      class SnakeGame extends JFrame implements Serializable