Skip to content

sweksha-cloud/Game-Manager-CS151-Fall-2025

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 

Repository files navigation

Game-Manager-CS151-Fall-2025

Course: CS151 Object-Oriented Design
Instructor: Professor Telvin Zhong
Semester: Fall 2025

Team Members: Abhik Das, Julia Husainzada, Sweksha Shaw, Matthew Yeh

Overview

This project is a full Java/JavaFX application that implements a Game Manager capable of launching two fully playable games: Blackjack and Snake. The project implements user login and account creation, persistent high score tracking for both games, loading and saving, and scene management for seamless navigation.

Design

Manager

  1. Main.java – JavaFX application entry point

  2. GameManager.java – Core manager handling game switching and global app state

  3. LoginView.java – UI logic for login screen

  4. MainMenuView.java – UI logic for main menu

  5. ToolbarView.java – Controls shared in-game toolbar

  6. AccountManager.java – Reads and writes user_accounts.txt

  7. HighScoreManager.java – Reads and writes high_scores.txt

  8. User.java – Represents a user account

  9. WelcomeView.java - Represents welcome view

Blackjack

  1. BlackjackGame.java – Runs core Blackjack gameplay: turns, betting, outcomes, and player management

  2. BlackjackVisualizer.java – Renders main Blackjack table and controls

  3. Card.java – Represents a card

  4. Deck.java – Manages a full deck

  5. Hand.java – Stores and evaluates a player hand

  6. Player.java – Abstract base class or interface

  7. HumanPlayer.java – Human-controlled player

  8. BotPlayer.java – CPU-controlled player (same class for multiple bots)

  9. Dealer.java – Dealer AI with fixed rules

  10. TestVisualizer.java – Visualization harness for testing UI components

  11. BJExitGameView.java - JavaFX exit screen handling quit confirmation and returning to menu.

  12. BJStartGameView.java - Initial start menu screen for configuring options and beginning Blackjack games.

  13. BJViewManager.java - Coordinates switching between start, game, and exit views or scenes.

  14. DeckEmptyException.java - Error when drawing from empty deck

  15. HandVisualizer.java - Displays a hand’s cards and totals

Snake Game

  1. SnakeGame.java – Main Snake controller/manager

  2. SnakeController.java – JavaFX UI controller

  3. Snake.java – Contains snake segments and movement logic

  4. Food.java – Represents food items on the board

  5. Board.java – Board grid and rendering logic

  6. Direction.java – Enum for movement directions

  7. CollisionManager.java – Collision helper

util

  1. EncryptionUtils.java - Add encryption and decryption for text username/password and cards

resources

  1. styles.css: UI stylesheet to keep text visible even when field is focused

Installation Instructions

  1. Install Maven: Make sure Apache Maven is installed and added to your system PATH.
  2. Clone the repository: git clone https://github.com/sweksha-cloud/Game-Manager-CS151-Fall-2025
  3. Navigate to JavaFX project: cd Game-Manager-CS151-Fall-2025/democs151javafx
  4. Build the project: In your terminal, run mvn clean compile

Usage

general

  1. Login or create an account, the nav-bar at the top will always be available to exit the game or logout.
  2. You may view the scoreboard or select either blackjack or snake game

blackjack instructions and usage

  1. The game is played with 1 human player and 3 automated characters (2 computer players and 1 dealer).

  2. Players take turns drawing cards to reach a hand value as close to 21 as possible without going over.

  3. Placing Bets

  • Before each round, you can place a bet between $1 and $20.

  • Use the provided buttons or input field (depending on your UI) to select your bet amount.

  1. Playing a Round
  • Click Hit to draw a card.

  • Click Stand to end your turn.

  • Automated characters play their turns automatically.

  • The dealer follows standard Blackjack rules (hits until 17 or higher).

  1. Winning and Losing
  • If your hand exceeds 21, you bust and lose your bet.

  • If the dealer busts, all remaining players win their bets.

  • Otherwise, hands are compared to the dealer:

  • Higher hand than the dealer → win

  • Equal hand → push (no money lost)

  • Lower hand → lose

  1. Exiting the Game
  • Click the Exit button to close the game at any time.

  • Your final balance is displayed when you exit.

  1. Notes
  • The game uses mouse input only—keyboard input is not required.

snake game instructions and usage

  1. Controls
  • Use the arrow keys on your keyboard to control the snake:
  • Up Arrow → move up
  • Down Arrow → move down
  • Left Arrow → move left
  • Right Arrow → move right
  1. Gameplay
  • The goal is to eat the food that appears on the screen to grow your snake.

  • Each time the snake eats food, your score increases.

  • Avoid hitting the walls or colliding with yourself, which will end the game.

  1. Exiting the Game
  • Close the game window to exit at any time.

  • Your final score will be displayed when the game ends.

  1. Notes
  • The game uses keyboard input only; mouse input is not required.

Contributions

Abhik Das (Ab2d248):

Created and worked on:

  1. BlackjackVisualizer.java
  2. Card.java
  3. Deck.java
  4. Hand.java
  5. TestVisualizer.java
  6. BJExitGameView.java
  7. BJStartGameView.java
  8. BJViewManager.java
  9. DeckEmptyException.java
  10. HandVisualizer.java
  11. State transitions and Dynamic view switching
  12. Unit Tests

Julia Hussainzada (juliahusainzada):

Created and worked on:

  1. Main.java
  2. GameManager.java
  3. LoginView.java
  4. MainMenuView.java
  5. ToolbarView.java
  6. AccountManager.java
  7. HighScoreManager.java
  8. User.java
  9. WelcomeView.java
  10. Encryption/Decription
  11. Unit Tests

Sweksha Shaw (sweksha-cloud):

Created and worked on:

  1. BlackjackGame.java
  2. Player.java
  3. HumanPlayer.java
  4. BotPlayer.java
  5. Dealer.java
  6. README.md

Matthew Yeh (mattthewyeh):

Created and worked on:

  1. SnakeGame.java
  2. SnakeController.java
  3. Snake.java
  4. Food.java
  5. Board.java
  6. Direction.java
  7. CollisionManager.java
  8. Music for snake game

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors