seng300-project is our recreation of an online multiplayer game, or OMG for short.
To launch OMG it would require an installation of javafx and the database our company as used.
Follow these steps to install JavaFX and set up your development environment.
Before installing JavaFX, ensure that you have the following prerequisites:
- Java JDK: JavaFX requires a Java Development Kit (JDK) version 8 or above.
- Download the JDK from the official Oracle website or AdoptOpenJDK.
- Ensure that the
JAVA_HOMEenvironment variable is set correctly, and Java is added to the system'sPATH.
Go to the official JavaFX website and download the latest JavaFX SDK version compatible with your operating system.
- Windows: Choose the
.zipfile. - Mac OS: Choose the
.tar.gzfile. - Linux: Choose the
.tar.gzfile.
Once the download is complete:
- Windows: Extract the
.zipfile to a desired location on your system. - Mac/Linux: Extract the
.tar.gzfile to a desired location on your system.
If you're using an Integrated Development Environment (IDE) like IntelliJ IDEA, Eclipse, or Visual Studio Code, configure it to include JavaFX libraries.
Adding JavaFX to the Project Structure
- Open the game project with IntelliJ IDEA.
- Press the Gear Icon in the top right corner and then Project Structure.
- In the Libraries section, click + and select Java.
- Navigate to the
libfolder inside the extracted JavaFX SDK and add it. - Press Apply and Ok to close.
Creating a Run Configuration
-
Click Current File beside the Run button on the top right.
-
At the bottom of the drop menu press Edit Configurations.
-
Click Add new configuration and select Application.
-
Give the Run Configuration a name and set the Main Class to the GUI class you want to run.
- Generally this class will be the StartController class in the source directory.
-
Click on Modify Options and choose Add VM Options.
-
Add the following VM options and replace /path/to/javafx-sdk-/lib with the path to the JavaFX lib directory on your computer:
--module-path /path/to/javafx-sdk-<version>/lib --add-modules javafx.controls,javafx.fxml
-
Create a new Java project.
-
Right-click on the project and select Build Path > Configure Build Path.
-
Add the
libdirectory of the JavaFX SDK to the build path. -
Under Run Configurations, add the VM arguments:
--module-path /path/to/javafx-sdk-<version>/lib --add-modules javafx.controls,javafx.fxml
-
Install the Java Extension Pack from the VS Code marketplace.
-
Open the project folder and create a
launch.jsonfile inside the.vscodefolder with the following configuration:{ "type": "java", "name": "Launch JavaFX", "request": "launch", "mainClass": "com.example.Main", "vmArgs": "--module-path /path/to/javafx-sdk-<version>/lib --add-modules javafx.controls,javafx.fxml" }
We can not confirm if these methods work on Eclipse or Visual Studio Code. Please use your due diligence and request help if needed.
You can contact the devs of OMG by email or at our website.
Thank you for choosing
- Update based on Nova's server or XAMPP
- Go to the official XAMPP website.
- Download the version for your operating system (Windows, macOS, or Linux).
- Run the installer.
- Follow the installation wizard:
- Click Next on all prompts (you may leave all default components selected).
- Once installed, open the XAMPP Control Panel.
- On macOS, launch the
manager-osxapp.
- In the XAMPP Control Panel, click Start next to:
- Apache – This launches your local web server.
- MySQL – This starts your local MySQL database
- Ensure both services are running. A green status indicator should appear for each.
- Open your web browser.
- Navigate to: http://localhost/phpmyadmin/
- You should see the phpMyAdmin dashboard interface.
- Download the MySQL Connector J from the official website.
- Choose Platform Independent and download the
.zipfile. - Extract the archive and locate the
mysql-connector-j-<version>.jarfile. - In your Java project:
- Go to File > Project Structure > Libraries
- Click + → Java, then select the JAR file.
- Click Apply and then OK.
- In phpMyAdmin, go to the SQL tab.
- Execute the following SQL statements one at a time:
CREATE DATABASE OMGAMEDB;
CREATE TABLE Accounts (
ID INT AUTO_INCREMENT PRIMARY KEY,
Username VARCHAR(255) NOT NULL UNIQUE,
Email VARCHAR(255) NOT NULL UNIQUE,
Password VARCHAR(255) NOT NULL,
Friends VARCHAR(1024) NOT NULL,
Statistics TEXT,
MatchHistory TEXT
);
CREATE TABLE Matchmaking (
ID INT PRIMARY KEY,
STATE VARCHAR(255),
GAME VARCHAR(255),
START_TIME FLOAT(32),
RECENT_TIME FLOAT(32),
ELO INT,
ELO_RANGE INT,
OPPONENT_ID INT,
NETWORKING_INFO VARCHAR(255),
ROOM_CODE VARCHAR(255)
);Thank you for choosing
- Go to the official SENG p-2 discord
- Open the Authentication-profile-team channel
- Open pinned messages (top right corner)
- Download the jakarta.activation-2.0.1.jar AND jakarta.mail-2.0.1.jar packages
Note: The official jakarta releases can be found on their github repo https://github.com/jakartaee/mail-api/releases. Jakarta mail official website: https://jakartaee.github.io/mail-api/README-JakartaMail Jakarta activation official website: https://jakartaee.github.io/jaf-api/
If you're using an Integrated Development Environment (IDE) like IntelliJ IDEA, Eclipse, or Visual Studio Code, configure it to include jakarta libraries.
Adding JavaFX to the Project Structure
- Open the game project with IntelliJ IDEA.
- Press the Gear Icon in the top right corner and then Project Structure.
- In the Libraries section, click + and select Java.
- Navigate to the
jakarta.activation-2.0.1.jarpackage wherever you downloaded it - Press Apply and Ok to close.
- repeat this step for the 'jakarta.mail-2.0.1.jar' package
Thank you for choosing
Purpose: Companies contract that everyone signed and was created by Project Manager and the Team Leads.
Game logic documentation developed during the initial phase of the project.
Purpose: The GameLogicPlanning.pdf outlines a structured development plan divided into five sprints to implement and test logic for several turn-based games including Chess, Checkers, Connect Four, and Tic Tac Toe. The team focused on classes and use case diagram creation, core gameplay implementation, and feature integration, while assigning specific components and responsibilities to different members to ensure modular and agile development.
Purpose: This document outlines the use case scenarios for various gameplay mechanics in a multiplayer strategy game system, focusing on features such as playing a game, moving pieces, and performing specific actions like castling, en passant, and offering a draw. Each use case details the actors involved, preconditions, triggers, scenarios, postconditions, exceptions, and priority, aiming to ensure the game operates smoothly and realistically according to chess, checkers, Connect 4, and tic-tac-toe rules.
Purpose: GUI documentation developed during the initial phase of the project.
Purpose: Rough concept of the main layout/design of the game.
Purpose: Polished version of main layout/design of the game.
Purpose: Networking documentation developed during the initial phase of the project.
- ErrorHandlingImplementation.md
- meetingNotes.md
- NetworkingConcepts.md
- NetworkingFunctionsDocs.md
- NetworkingSystemOverview.md
- use_case_descriptions.pdf
Purpose: This document outlines the finalized error handling and failure recovery strategies implemented in the multiplayer system, including disconnection detection, reconnection workflows, and turn synchronization. It also details future-ready features like retry logic for move transmission and safeguards to maintain game integrity and prevent exploits.
Purpose: The team meeting on March 26 covered recent progress, including updates to documentation, diagrams, and code stubs, as well as leadership and coordination efforts. Upcoming goals focus on finalizing planning, preparing for code implementation (especially networking and chat features), and ensuring equal contributions from all members ahead of the demo.
Purpose: This document outlines how game logic and networking interact in the multiplayer system, detailing client-side implementation, data structures like GameState, Board, and GameRules, and how they're synchronized over the network. It also proposes a tentative matchmaking and session management plan while emphasizing modularity, future enhancements, and the need for team-wide alignment before finalizing any implementations.
Purpose: This document consolidates all networking-related components and stubs for P3, including server-client architecture, turn-sync logic across all four games, and placeholder systems for chat and matchmaking. It serves as a comprehensive guide for developers and integration teams, detailing current functionality, planned upgrades, and how networking is simulated via Networking.java.
Purpose: This document finalizes the networking system for P3, detailing the dual-layer architecture—live server-client flow and stubbed multiplayer simulation via Networking.java. It outlines implementation across all games, integration with other teams (GUI, Logic, Auth, Leaderboard), and prepares for future features like matchmaking and reconnection. All core networking stubs are fully functional and documented, making the system modular, testable, and demo-ready.
Purpose: The use case descriptions outline the steps for player connection, gameplay, and connection management in a multiplayer game. They cover scenarios like connecting to the server, matchmaking, making moves, synchronizing game state, handling disconnections, and processing game logic to ensure smooth gameplay.
Purpose: Profile & Matchmaking documentation developed during the initial phase of the project.
- matchmaking.md
- README.md
- use_case_descriptions_01.pdf
- use_case_descriptions_02.pdf
- use_case_descriptions_03.pdf
- use_case_descriptions_05.png
Purpose: The matchmaking system adjusts player Elo based on their rating, with a default range of ±100 Elo, expanding over time if no match is found. Elo adjustments are game-specific, with higher K-factors for strategic games like Chess and lower K-factors for simpler games like Tic-Tac-Toe, ensuring fair competition while limiting rapid rating inflation.
Purpose: The Profile & Matchmaking Team has documented the matchmaking process and created class structure, sequence, and use case diagrams for various aspects, such as account creation, matchmaking, and leaderboard generation. These diagrams and related documents help illustrate the key components of the system, including authentication, password encryption, multi-factor authentication, and managing friends.
Purpose: The use cases describe various matchmaking and game interaction scenarios. Players can queue for matches, host or join private matches using a match ID, select the game to play, and even spectate ongoing matches with a match ID. Key priorities include supporting core functionality like game selection and matchmaking, while features like spectating and private matches have lower priority due to being optional or for specific player preferences.
Purpose: The use cases describe account creation, editing, guest account functionality, and identity verification processes. Players can create and edit accounts, play as guests, and verify their identity when logging in, with account creation and guest play being high-priority, frequently used features, while identity verification is lower priority and less frequent.
Purpose: These use cases cover the functionality for players to search for other players, send friend requests, manage incoming requests, and remove friends. While not essential to core gameplay, these features enhance social interaction and are frequently used to build and manage a player's friend network.
Purpose: The use case diagrams shows a rough overview of authentications player to system steps.
Purpose: A detailed project planning document for various teams working on different aspects of a game development project. Each team, such as the Game Logic, GUI, Authentication/Profile, Leaderboard/Matchmaking, Networking, and Integration teams, has their own set of objectives and tasks, with timelines and statuses.
Purpose: Every class diagrams from all teams.
Purpose: Game's logic class diagram.
Purpose: Game's logic use case diagrams.
Purpose: Screens and Sprites that will be used in the main game.
Purpose: All screens that will be implemented in the project.
Purpose: All sprites that will be implemented in the project.
- integration
- (DRAFT)error_handling_1 mermaid diagram.png
- (DRAFT)error_handling_2 mermaid diagram.png
- (DRAFT)_use_case.png
- figjamLink.txt
- gameClassDiagram.png
- gameProcess.png
- player_and_localhostSetup.png
- tentativeGameStateTransitionDiagram.png
Purpose: Images on how to integrate each part
Purpose: Integration diagram with the leaderboard, matchmaking and authentication with buttons.
Purpose: Integration diagram with the game's included with buttons.
Purpose: Integration diagram with the gui and buttons.
Purpose: Integration diagram with the networking and database.
Purpose: Diagram for player's turn errors.
Purpose: Diagrams for a player being disconnected.
Purpose: Diagrams for client side connection.
Purpose: Link to all figma diagrams in case It's hard to see.
Purpose: Diagrams for connecting two player with a server.
Purpose: Diagram for how the game will function.
Purpose: Diagram to set up the local host to connect the two players.
Purpose: Diagram for turn base from two players.
Purpose: Holds every class structure from Profile and Matchmaking team.
Purpose: Holds every sequence diagrams from Profile and Matchmaking team.
Purpose: Holds every sequence diagrams from Profile and Matchmaking team.
-
-
- AdminScreen.fxml
- Connect4.fxml
- draw_styles.css
- DrawScreen.fxml
- GameSelect.fxml
- Help.fxml
- LeaderboardScreen.fxml
- LeaderboardStyle.css
- Login.fxml
- lose_styles.css
- LoseScreen.fxml
- MatchType.fxml
- MenuPopup.fxml
- MFAPopup.fxml
- P1Checkers.fxml
- P1Chess.fxml
- P2Checker.fxml
- P2Chess.fxml
- Signup.fxml
- Start.fxml
- styles.css
- TicTacToe.fxml
- Userpopup.fxml
- UserProfile.fxml
- UserSettings.fxml
- WinScreen.fxml
- AStatistic.java
- IStatistics.interface
- MatchOutcomeHandler.java
- MatchOutcomeInvalidError.exception
- StatisticsCheckers.java
- StatisticsChess.java
- StatisticsCombined.java
- StatisticsConnect4.java
- StatisticsTicTacToe.java
- StatisticType.enum
- Account.java
Purpose: This abstract class implements the IStatistics interface, providing a structured framework for initializing, validating, and updating game-related statistics for an account. It differentiates between simple statistics and those requiring specialized handling—such as ELO and win rate—which are treated as complex metrics and updated via custom logic. Additionally, the class manages the accumulation and retrieval of statistics, ensuring consistency by automatically recalculating derived values like win rate whenever related statistics change.
Purpose: This interface defines the contract for managing game-related statistics for an account, including setting, validating, and retrieving various metrics. It distinguishes between standard statistics and those that require special handling, ensuring that complex statistics cannot be updated through simple addition. Additionally, it provides specific methods to add new statistics and update the ELO rating, thereby standardizing how statistics are maintained across different implementations.
Purpose: This class manages the recording of match outcomes by updating player statistics and logging match history. It first ensures that the match outcome is valid and then updates both players' statistics, including a detailed log entry that captures the match result, opponent details, and match date. Additionally, if applicable, it recalculates and updates the players’ Elo ratings using game-specific calculations based on the match score and expected outcomes.
Purpose: This class defines a custom exception specifically for handling invalid match outcomes in the system. It extends the standard Exception class, allowing it to be thrown when match result conditions are not met. By offering both a no-argument constructor and one that accepts an error message, it provides flexibility in conveying detailed error information.
Purpose: This class extends a base statistics implementation to specifically handle Checkers game metrics for an account. It defines an array of accepted statistics, including ELO, win rate, wins, losses, draws, matches played, number of turns, pieces captured, and multi-captures. Two constructors ensure that default values (like an initial ELO of 1000) are set up, with one allowing those defaults to be overridden by provided statistic values.
Purpose: This class specializes the base statistics framework for chess by defining a comprehensive set of accepted statistics that include game outcomes, captured pieces across various types, and specific chess actions like checks, checkmates, and promotions. It extends the abstract base class to inherit functionality for initializing, updating, and retrieving these statistics while ensuring consistency with the chess game metrics. Two constructors are provided: one that initializes the statistics with default values via the initializeHashMap() method, and another that accepts a custom statistics map for more flexible initialization.
Purpose: This class aggregates multiple game statistics objects into a unified set of statistics. It iterates over each provided statistics object, summing non-complex metrics while computing an average for complex ones like ELO. Finally, it updates the overall ELO and recalculates the win rate based on the aggregated data.
Purpose: This class specializes the abstract statistics framework for the Connect 4 game by defining specific metrics such as ELO, win rate, wins, losses, draws, matches played, number of turns, and wins blocked. It ensures these statistics are properly initialized, either with default values or using a provided statistics map, to accurately reflect a player's performance in Connect 4. The class leverages inheritance to maintain consistent behavior with other game-specific statistics classes while focusing on metrics unique to Connect 4 gameplay.
Purpose: This class specializes the abstract statistics framework for Tic Tac Toe by defining metrics such as ELO, win rate, wins, losses, draws, matches played, number of turns, and wins blocked. It initializes these statistics with default values using an initialization method, ensuring a consistent starting point for tracking a player's performance. Additionally, it provides an alternative constructor that allows initialization with a pre-defined statistics map, supporting flexible data management for the game.
Purpose: This enum defines a comprehensive list of statistics that each game must track, ranging from basic metrics like wins, losses, and draws to complex ones like ELO and win rate. It overrides the toString method to convert enum values into human-readable formats by splitting the identifier and capitalizing each word. Additionally, it provides a fromString method to convert a formatted string back into its corresponding enum value, facilitating easy parsing and display of statistics.
Purpose: This class represents a user account in the system, encapsulating key data such as a unique ID, username, email, password, friend list, and game-specific statistics including match history and queue status. It provides constructors for both guest and permanent accounts and includes methods to update and retrieve game statistics, manage matchmaking queues, and log match outcomes. Additionally, it handles account operations like converting guest accounts, validating and updating profile information, and interfacing with the database and matchmaking handler to ensure data consistency and proper account management.
Purpose: This class provides utility methods for converting various account data—such as match history, game statistics, and friends lists—into and from string representations. It defines custom delimiters and formats to serialize complex data structures, enabling the data to be stored easily and then reconstructed accurately. Additionally, it reconstructs game-specific statistics objects from the serialized data, ensuring proper mapping for games like chess, checkers, Connect 4, and Tic Tac Toe.
Purpose: This class handles the creation of new user accounts by validating input data such as username, email, and password using regular expressions. It ensures the credentials meet defined security and formatting requirements before proceeding. Once validated, it encrypts the account details and saves the account to the database, while displaying error messages when any validation fails.
Purpose: This class defines a custom exception, NoAccountError, that signals an error when an operation tries to access account details not available for a guest account. It extends the standard Exception class, making it compatible with Java’s exception handling mechanism. Two constructors are provided—one default and another that accepts a custom error message—to allow for flexible error reporting.
- Admin.java
- CAPTCHAAuthentication.java
- EmailSender.java
- MFAAuthentication.java
- MFAAuthenticationV2.java
- MFAInputPopUp.java
Purpose:
- This class provides backend functionality for managing and modifying a users account within our system Users can update their email, passwords, usernames and more while interacting with the database
Purpose:
- Simple CAPTCHA system to verify that a human is interacting with the application.
This helps support math, image, and text based CAPTCHA. This was integrated within the Authentication folder to prevent bots from entering the system.
* MATH CAPTCHA:
- A random equation is generated for the user to answer * TEXT CAPTCHA:
- A random set of words are generated for the user to answer * IMAGE CAPTCHA:
- A random image is chosen from one of the CAPTCHAImages folder to be output to user
Purpose:
- This class sends a 6-digit verification code via email using the Jakarta Mail API. This class connects the Gmail's SMTP server with an app-specific password and then sends the code to the users email. Used for MFA verification.
Purpose:
- Simple MFA is integrated within our system. A random 6-digit code is generated and sent to the users email, the user receives the email on our system, enters in the code to be verified.
- However, before a verification code is sent to the users email, the database checks if the email exists on file first. Then proceeds with further steps.
Purpose:
- Sends a code to user's email, user enters the code, if the code is incorrect an Exception is thrown
Purpose:
- This class creates a JavaFX pop-up dialog for entering an MFA code. It verifies the input with the expected code, it displays a success or error an message, and returns the result. It will return null if the code is incorrect.
- CAPTCHAuthenticationFailedException.exception
- DecryptionFailedException.exception
- EncryptionFailedException.exception
- MFAAuthenticationFailedException.exception
Purpose: This class defines a custom exception that is thrown when CAPTCHA authentication fails. It extends Java’s standard Exception class to integrate with the language's error-handling mechanisms. The constructor accepts a custom error message, allowing detailed context to be provided when the exception is raised.
Purpose: This class defines a custom exception called DecryptionFailedException, which extends the standard Exception class. It is used to signal that a decryption process has failed, allowing the error to be caught and handled specifically. Its constructor accepts a custom error message to provide further details about the decryption failure.
Purpose: This class defines a custom exception called EncryptionFailedException, which is used to indicate that an encryption process has failed. It extends the standard Exception class and includes a constructor that accepts a detailed error message, enabling precise error handling during encryption operations.
Purpose: This class defines a custom exception for signaling a failure during the multi-factor authentication process. It extends the standard Exception class, integrating seamlessly into Java's error handling system. The constructor accepts a custom error message, which provides detailed context when MFA authentication fails.
Purpose: This class serves as the controller for a JavaFX MFA pop-up, handling user verification during multi-factor authentication. It retrieves the code entered by the user from a text field and compares it to a pre-set verification code. If the codes match, it displays a success alert and closes the pop-up window; if not, it shows an error alert prompting the user to try again.
Purpose: This class serves as the entry point for a JavaFX application that displays different game outcome screens. It loads an FXML file—in this instance, the win screen—to set up the user interface, assigns a window title ("You Win!"), and sets the scene dimensions to 800 by 600 pixels. Additionally, alternative screens for scenarios such as a draw, loss, or leaderboard display are provided as commented-out options, and the main method launches the application.
Purpose: This class manages MySQL database connections by providing static methods to both establish and close connections using the JDBC driver. It attempts to connect to a database with hardcoded credentials—configured by default for a local XAMPP setup—with alternate settings commented out for a different server environment. Additionally, it handles potential exceptions for driver loading and SQL errors, ensuring that connections are properly closed when no longer needed.
Purpose: This class acts as the central gateway between the application and the database for managing account-related data. It provides a variety of static methods to query accounts (by ID, email, or username), retrieve players queued for specific games, and convert complex stored data—such as match history, statistics, and friends lists—into in-memory Java objects. Additionally, it handles account persistence operations, including saving (inserting or updating), deleting, and secure login processes that involve encryption and decryption, as well as generating temporary IDs for guest accounts.
Purpose: This class uses a simple Caesar cipher technique with a fixed shift of 3 to decrypt strings by reversing the character shift applied during encryption. It includes internal helper methods that shift characters and reverse that process, ensuring that decryption is applied correctly and handles null or exceptional cases gracefully. Additionally, it provides a driver method for decrypting generic strings and a specialized method for decrypting an Account's email and password fields, throwing a DecryptionFailedException when decryption fails.
Purpose: This class implements a simple encryption mechanism using a Caesar cipher with a fixed shift of 3, where each character in the input string is shifted by the specified amount. It includes helper methods to perform the character shifting and constructs the encrypted string while handling null inputs and exceptions by throwing an EncryptionFailedException when needed. Additionally, it provides a method to encrypt an Account object's email and password fields, updating the account with the encrypted values.
- checkers
- Chess
- connect4
- pieces
- tictactoe
- Board.java
- Game.java
- GameRules.java
- GamesEnum.enum
- GameState.enum
- GameType.enum
- Player.java
Purpose: This class encapsulates the core gameplay logic for a checkers game by managing players, board state, and game state, including tracking turns, captures, multi-captures, and piece promotions. It implements key rules such as forced captures, valid movement checks for both regular and king pieces, and conditions for surrender, draw, and win scenarios. Additionally, it integrates network communication to update and synchronize the game state between opponents during multiplayer gameplay.
Purpose: This class represents an individual checkers piece, extending the functionality of a generic moving piece while adding checkers-specific behavior. It includes a boolean state to track whether the piece has been promoted to a king, which allows it to move backwards. The class overrides the move and isValidMove methods to accommodate checkers rules, although the validity-check logic remains a placeholder for further implementation.
Purpose: This class implements a bishop piece for chess, extending the generic MovingPiece class with behavior specific to the bishop's diagonal movement. It overrides the move and isValidMove methods to ensure that the bishop only moves diagonally, that all intermediate tiles along the path are empty, and that the destination tile is either empty or occupied by an opposing piece. Additionally, each bishop is assigned a fixed score of 3, reflecting its value in the game, and the class includes boundary checks to prevent illegal moves.
Purpose: This class serves as the central controller for a chess game by initializing the board with pieces for two players, managing player turns, and handling move validation including checks for legal moves, exposing the king to check, and detecting special conditions like pinning. It simulates moves to verify safety, updates scores and capture counts, and checks for win conditions such as checkmate, draw, or surrender. Additionally, it integrates network communication to send and receive game state updates, ensuring that both players remain synchronized during multiplayer gameplay.
Purpose: This class models a chess king by extending the generic moving piece functionality, handling both standard one-square moves in any direction and the special castling move. It overrides the move and isValidMove methods to ensure that, beyond normal boundary and occupancy checks, the king can only castle if neither it nor the associated rook has moved and if all squares between them are empty. Additionally, when castling is detected, the class also moves the appropriate rook to complete the maneuver, while tracking the king's movement status to prevent subsequent castling.
Purpose: This class defines a chess knight piece by extending the generic moving piece functionality and assigning it a fixed score of 3. It overrides the move and isValidMove methods to enforce the knight’s L-shaped movement pattern, which allows it to jump over other pieces while ensuring that the destination is either vacant or occupied by an opponent’s piece. Through these specialized behaviors, it accurately models the unique movement rules and strategic value associated with the knight in chess.
Purpose: This class models a chess pawn by extending a generic moving piece, with specific attributes (doneFirstMove and doneSecondMove) to track whether it can move two spaces forward on its initial move and whether it is vulnerable to an en passant capture. The move method incorporates standard single and double forward advances, diagonal captures (including en passant), and updates these flags accordingly. Additionally, the class provides methods for checking promotion eligibility and executing promotion to a knight, bishop, rook, or queen when the pawn reaches the opposite end of the board.
Purpose: This class represents a queen chess piece, extending generic movement capabilities and assigning it a high scoring value of nine. It overrides the move and isValidMove methods to allow the queen to move any number of unobstructed squares along diagonals, horizontals, or verticals, similar to combining the movements of a rook and a bishop. Additionally, the class ensures that the destination square is either empty or occupied by an opposing piece, allowing the queen to capture enemy pieces efficiently.
Purpose: This class models a rook chess piece by extending the generic moving piece functionality while assigning it a specific scoring value. It verifies that the rook's movement is valid by ensuring it travels in a straight line—either horizontally or vertically—with no obstructions along its path. Additionally, the class maintains a flag to track whether the rook has moved before, which is essential for enabling the special castling move in chess.
Purpose: This class encapsulates all Connect 4 game logic by initializing players, board, score, and game state, while also setting up necessary game rules and networking support for multiplayer synchronization. It provides a move method that places a piece into the first available slot in a chosen column and then checks for winning conditions by scanning rows, columns, and both diagonal directions for four consecutive matching pieces. Additionally, it manages game outcome states including wins, draws, and player surrenders, updating and communicating the game state accordingly over the network.
Purpose: This class defines a Connect 4 game piece by extending a stationary piece, which implies that once it is placed on the board it doesn't move. It initializes the piece with its color, type, and the player who owns it, inheriting common properties from its superclass. Essentially, it serves as a marker for a player's move in the Connect 4 game.
Purpose: This abstract class serves as a foundation for all moving game pieces used in chess and checkers by extending a more general Piece class. It maintains the piece's x and y coordinates and provides getter and setter methods for position management. Additionally, it declares two abstract methods—move and isValidMove—that must be implemented by subclasses to handle the piece-specific logic for movement and move validation.
Purpose: This abstract class serves as the base for all game pieces across various board games by encapsulating common properties such as color, owning player, score, and piece type. It provides getter methods to access these attributes and includes a default implementation for checking if a piece is a king, which subclasses can override as needed.
Purpose: This enum defines two constants—LIGHT and DARK—to differentiate between the two types of pieces in games like chess, representing the opposing sides such as white and black. It is used to determine movement directions and enforce piece-specific rules based on their type. By using an enum, the code ensures type safety and clarity when handling piece attributes throughout the game logic.
Purpose: This abstract class defines a stationary game piece that, once placed, remains fixed on the board. It extends the base Piece class to inherit common properties such as color, piece type, and the owning player, while setting a default score of one. Essentially, it provides a simple foundation for non-moving game pieces used in various board games.
Purpose: This class implements a complete Tic Tac Toe game by extending a generic game framework. It initializes players, a board, and assigns piece types randomly to the two players, then manages moves by placing pieces if the target cell is empty. Additionally, it continuously checks for win conditions across rows, columns, and diagonals, updates the game state to reflect wins, draws, or a player surrender, and synchronizes the game state over the network for multiplayer gameplay.
Purpose: This class defines a Tic Tac Toe game piece by extending a stationary piece, meaning once it is placed on the board it doesn't move. It initializes the piece with its color, type, and owner, and inherits common properties from its superclass, serving as a marker for a player's move in the Tic Tac Toe game.
Purpose: This class models a game board as a two-dimensional array of pieces, setting its dimensions dynamically based on the specific game type (for example, 8x8 for chess and checkers, 3x3 for tic tac toe, and 6x7 for Connect 4). It offers specialized methods to fill the board with the appropriate pieces for chess (via fillChessBoard) or checkers (via fillBoard), as well as generic utility functions such as placing a piece, checking if the board is full, and resetting the board to its initial state. Overall, it serves as a flexible, game-agnostic foundation for displaying and manipulating the state of various board games.
Purpose: This abstract class lays out the general framework for any game by defining shared properties such as players, scores, game type, board, state, and rules. It enforces a contract through abstract methods—checkWinCondition, surrender, and matchOutcome—that must be implemented by any concrete subclass to handle game-specific logic. This design promotes consistency and modularity, allowing various game types to extend and customize behavior while reusing common attributes.
Purpose: This class is designed to serve as a container for rules governing a game, centralizing any logic or constraints that might apply. Although it's currently empty, it provides a structural placeholder that can be extended with rule-specific functionality in the future. In the overall game framework, it standardizes the concept of game rules, facilitating uniform management across different game types.
Purpose: This enum lists all the game types supported by the online gaming platform—CHECKERS, CHESS, CONNECT4, and TICTACTOE. It serves as a type-safe way to reference games across the system, helping ensure consistency and clarity in the codebase. Additionally, using an enumeration for game types reduces the likelihood of errors when handling or switching between different games.
Purpose: This enum defines all possible states that a game can be in within the platform. It includes states to indicate whose turn it is (P1_TURN, P2_TURN), outcomes like wins for either player (P1_WIN, P2_WIN) or a draw (DRAW), a condition where a king is in check (IN_CHECK), and the initial setup phase (SETUP). Using this enum standardizes game state management across different game types, ensuring consistent handling of game progress throughout the application.
Purpose: This enum defines the different types of games available on the platform: CHESS, CHECKERS, CONNECT4, and TICTACTOE. It overrides the toString method to provide a human-readable, title-cased representation of each game type. Additionally, it includes a fromString method that converts a string back into the corresponding GameType enum value, ensuring robust handling of game type data.
Purpose: This class represents a player in the game. It stores basic information, such as the team (as a string), and includes a constructor that outputs a debug message when a player is created. The class also declares methods for retrieving win and lose counts, checking turn status, and surrendering, though these methods currently return default values or are stubs, indicating that further implementation is expected.
Purpose: This folder contains all sprites used in the OMG game.
Purpose: All the png that is not in the sprites folder is being used as a screen in the game.
Purpose: This class builds a leaderboard for a specified game by retrieving accounts from the database or a user's friend list and sorting them based on a chosen statistic (e.g., Elo, win rate, wins) in either ascending or descending order. It then formats the sorted results into a two-dimensional String array that includes a header row and subsequent rows containing details such as rank, username, Elo, win rate, total wins, and an additional statistic selected by the user. Additionally, the class handles guest account verification (throwing a NoAccountError for guest accounts in the friends leaderboard) and incorporates pagination parameters (although currently not used) when constructing the leaderboard.
Purpose: This class handles the matchmaking process by interfacing with a database to register players who wish to play a game, update their matchmaking details, and match them based on criteria such as game type and Elo differences. It provides methods for both hosting and joining a match, and utilizes two separate thread classes—HostingThread and MatchmakingThread—to continuously monitor and update matchmaking status asynchronously. When a match is found, it sets various parameters (such as player IDs, usernames, Elo ratings, and networking information) so that the game can start with both opponents synchronized.
Purpose: This thread class handles the matchmaking process for a player looking for an opponent. It continuously updates the player's matchmaking information (e.g., recent activity, Elo range, and networking details) in the database and periodically scans for other players who are also matchmaking and meet the matching criteria. Once a suitable opponent is found, it initiates a match by updating both players' matchmaking states and then removes the player’s record from the matchmaking table.
Purpose: This thread class represents the hosting component for matchmaking. It registers the host's matchmaking information (including game type, Elo, room code, and networking info) in the database, then enters a loop where it continuously checks whether another player has joined the room by monitoring the host's matchmaking state. Once an opponent is detected (state changes to FOUND_MATCH), it initiates a match and finally removes the host's entry from the matchmaking table.
Purpose: This enum defines the various states a user can be in during the matchmaking process, including OFFLINE, ONLINE, MATCHMAKING, FOUND MATCH, PLAYING, and HOSTING. It overrides the toString method to provide a human-readable, title-cased representation of each state and includes a fromString method to convert a string back to its corresponding enum value. This standardizes the handling of matchmaking statuses throughout the system.
Purpose: This class, GameServer, sets up and manages a server that listens for incoming socket connections on designated ports for both game-related data and chat communications, accepting two players to initiate a game session. It spawns a separate thread for each connected client via its nested ServerSideConnection class, which handles real-time exchange of game objects (to process moves and update gameplay state) and chat messages, employing integrated censorship logic to filter out prohibited language. Additionally, the class implements mechanisms to process player inputs, maintain game state (such as tracking turns and moves), and relay both game and chat information between clients to facilitate synchronous multiplayer gameplay.
Purpose: This class defines a simple data structure that encapsulates a player's message along with the player's number. It provides a constructor to initialize these fields and getter and setter methods to access and modify the player number and message. Overall, it serves as a basic model for passing messages between components in a networked environment.
Purpose: This class implements a JavaFX client that provides a graphical user interface for a player to participate in a networked turn-based game with integrated chat functionality. It manages the connection to the game server by establishing separate socket connections for game data and chat messages, handling input through button clicks, updating game state, and displaying chat messages while applying censorship to inappropriate content. Additionally, the class uses asynchronous threads to receive game updates and chat messages, ensuring that the user interface remains responsive during real-time multiplayer gameplay.
Purpose: This class defines a serializable object used for practice gameplay that encapsulates a win flag, a 2D character array representing the game board, and a test string for additional information. It enables instances to be transmitted over a network or saved to disk due to its implementation of the Serializable interface. This object is likely used for testing purposes within the networking system to simulate game state and communication between client and server.
Purpose: This Dockerfile uses the OpenJDK 23 base image in a Linux environment and sets the working directory to /app/src. It copies the source code into the container, exposes port 30000, creates a build directory, and compiles GameServerT.java into that build directory. Finally, it defines the entrypoint to launch the server by running the GameServerT class from the build directory using the Java runtime.
Purpose: This class implements a serializable container for storing a player's basic matchmaking data, including their user ID, username, and a HashMap of Elo ratings for different games. It also stores the game mode the player is interested in, allowing for dynamic updates and retrievals of this data through various getter and setter methods. Additionally, it provides a method to print a formatted summary of the player's data for debugging or logging purposes.
TPurpose: his class acts as an in-memory database, mapping global user IDs to their corresponding PlayerData objects and providing methods to add, remove, and retrieve player data. It allows querying and updating of players’ Elo ratings for specific game modes, as well as printing player information. Additionally, it includes a method to sort and return the top N players by Elo in a given game mode.
Purpose: This class, PlayerT, implements a Swing-based graphical client for a turn-based networked game, providing a user interface with menus, a 3x3 button grid for game moves, and integrated chat functionality. It manages layout updates and interactions by dynamically switching between the game menu and game scenes, handling user input for both game actions and chat messages. Additionally, it encapsulates client-side networking through an inner ClientSideConnection class that sends user moves and chat messages to the server and updates the display based on server responses.
Purpose: This class contains several nested stub classes that simulate key networking functions for testing purposes. The PlayerDatabaseStubs, GameServerStubs, PlayerDataStubs, and ChatStubs simulate database connections, Elo management, server hosting and connection acceptance, and chat message operations respectively, using simple logging and dummy data structures. Collectively, these stubs provide placeholder implementations that allow for testing integration and behavior of networking features in the absence of a full backend solution.
Purpose: This txt hold the censored words that the player cannot say.
Purpose: This class serves as a client-side networking utility, managing a cached game state and providing methods to send and receive the full game state between players while printing timestamped debug messages. It includes stub methods for connecting to a player, creating a game, and switching to listening mode, though the actual connection logic remains unimplemented. Additionally, it formats time using a specified pattern for clear debugging output regarding its networking operations.
Purpose: This file is a TrueType font file that contains scalable vector-based font data. It is typically used to render text in a specific, custom style within an application’s user interface.
Purpose: This file is a TrueType font file that likely provides a retro, pixelated text style. It is commonly used in video games or designs that want to evoke a classic arcade or 8-bit aesthetic.
Purpose: This file is another TrueType font file, likely designed with a retro gaming or pixelated theme in mind. It can be used to create a vintage video game look, reminiscent of arcade games from the 80s and 90s .
- AdminScreen.fxml
- Connect4.fxml
- draw_styles.css
- DrawScreen.fxml
- GameSelect.fxml
- Help.fxml
- LeaderboardScreen.fxml
- LeaderboardStyle.css
- Login.fxml
- lose_styles.css
- LoseScreen.fxml
- MatchType.fxml
- MenuPopup.fxml
- MFAPopup.fxml
- P1Checkers.fxml
- P1Chess.fxml
- P2Checker.fxml
- P2Chess.fxml
- Signup.fxml
- Start.fxml
- styles.css
- TicTacToe.fxml
- Userpopup.fxml
- UserProfile.fxml
- UserSettings.fxml
- WinScreen.fxml
Purpose: This is an FXML file for a JavaFX user interface layout designed for an "Admin Console" to manage user data. It features various interactive components, including:
-
User Input Fields for editing details such as User ID, Username, Email, and Password, alongside action buttons like "FIND USER," "CLEAR STATS," and "DELETE USER" to manage user accounts.
-
Tabs to organize the interface, with one tab dedicated to editing user information and another to handle graphical content.
-
Styling and Effects such as custom backgrounds, text formatting, gradients, and hover effects for buttons, providing a polished user experience.
The layout also includes a Tetris cat image with a playful message, reinforcing user engagement.
Purpose: This FXML file defines a user interface layout for a Connect 4 game, featuring a game board and various interactive components. Key elements include:
-
Game Board Grid: A 6x7 grid created with ImageView elements to represent the Connect 4 cells, where each cell can be clicked to make a move, with visual effects applied for interaction.
-
Player Info: Labels to display the usernames of two players (Player 1 and Player 2) with corresponding styling, including a playful font and color scheme.
-
Buttons and Navigation: Interactive buttons, such as a menu button and a chat button, allowing users to navigate between different game features or interact with the game.
This layout also utilizes background images, shadows, and hover effects for a polished and engaging user experience.
Purpose: This CSS file provides the styling for the win screen of a game. It includes:
-
Root Style: The font is set to "Press Start 2P", a retro gaming font, applied to the entire screen.
-
Background: The win screen (#drawScreenRoot) has a background color of light blue (#55AAFF) and a desert-themed image (desert_popup.png), with the image set to cover the screen without repeating.
-
Text Styling: The "YOU WIN" text (.draw-text) is styled with a warm brown color, bold font, and the "Press Start 2P" font, making it stand out against the background.
-
Button Styling: The buttons (.game-button) are styled with a transparent background, brown text, and the same retro font, with hover effects that change the text color to dark brown.
This style creates a visually appealing, retro-themed win screen with clear, bold text and interactive buttons.
Purpose: This FXML layout file defines the draw screen UI for a game, using JavaFX elements:
-
Root Layout: The root is a VBox (vertical box), which aligns its children to the center and has a 15px spacing between elements. The layout is styled using an external CSS file (draw_styles.css).
-
Text: A Label is displayed with the text "It's a Draw!", and it uses the draw-text style class to apply specific styling (such as font color and size).
-
Buttons: Inside an HBox (horizontal box), two buttons are placed:
-
"Main Menu" button, which triggers the handleMainMenu method when clicked.
-
"Start Over" button, which triggers the handleStartOver method when clicked. The buttons are styled using the game-button class defined in the external CSS file.
-
This layout provides a clean and functional draw screen where users can either return to the main menu or restart the game.
Purpose: This FXML layout defines the Game Selection Screen for a game application:
-
Root Layout: The root is an AnchorPane, which provides flexible positioning for its children elements. The background features a linear gradient from #169fd4 to #0174aa, and several images are used to enhance the UI's visual appeal.
-
Game Options: It includes several StackPane elements representing different games (Checkers, Connect4, Chess, TicTacToe) with clickable icons. When clicked, these options trigger methods like #switchToCheckers or #switchToChess.
-
Other UI Components: There are several images, labels, and rectangles to create a visually attractive interface, including a "Game Selection" text, a menu button to return to the home screen, and a leaderboard button for viewing the leaderboard. Additionally, the joinPopup pane is used for displaying a pop-up dialog with more information about the selected game. The overall design features effects like DropShadow to enhance the user experience.
Purpose: This FXML layout defines a Help Popup Screen for an application:
-
Design and Background: The AnchorPane has a background gradient with blue and light blue tones. Several ImageView elements display animated GIFs (e.g., tetriscat_swish.gif and tetriscat_paws.gif), creating a playful, visually engaging interface.
-
Help Text and Interactive Elements: The popup provides helpful information with texts like "need help? visit us at omgame.club for tips and other info!" and a small, humorous icon "(^. .^)" to represent the cat mascot. Additionally, a "SOS!" button is displayed in a tilted rectangular shape, prompting urgent help. The close button allows users to dismiss the popup.
-
Aesthetic Effects: The interface includes visual enhancements such as DropShadow effects on text and buttons, making the elements stand out and improving the user experience.
Purpose: This FXML layout defines the Leaderboard Screen for a game application:
-
Top Section: It contains buttons for selecting different game types (e.g., Tic Tac Toe, Chess, Checkers, Connect 4) and a back button for navigation. There are also toggle buttons to switch between "Global" and "Friends" leaderboard views and combo boxes to sort the leaderboard by different statistics.
-
Center Section: The main part of the screen features a TableView displaying leaderboard information such as Rank, Username, ELO, Win Rate, Wins, and Additional Stat. Below the table, there is a Pagination control for navigating between different pages of the leaderboard data.
-
Layout and Styling: The interface uses a BorderPane for overall layout, with content arranged in a VBox and HBox for proper alignment and spacing. It also uses a custom stylesheet (LeaderboardStyle.css) for styling. The TableView allows the leaderboard to dynamically display and sort player data.
Purpose: This CSS file defines the styling for the Leaderboard screen of a game application:
-
Root and Background Styling: The root container has a background image (leaderboardimg.png) that covers the entire screen. It uses the Segoe UI font for text, creating a sleek and clean look.
-
Labels and Buttons: The labels such as the game type and header have customized fonts, colors, and drop shadow effects for emphasis. The game buttons (e.g., Tic Tac Toe, Chess) have a gradient background with hover and pressed states that change color. Additionally, toggle buttons for the "Global" and "Friends" views have interactive effects and customized background colors.
-
Table and Pagination: The TableView displaying leaderboard data is styled with alternating row colors, a gradient column header, and a hover effect for better visibility. The pagination control has rounded buttons and a clean design to navigate through pages of the leaderboard.
-
Dropdown and ComboBox Styling: The combo boxes for sorting and additional stats have smooth, rounded edges, with hover effects for the user interface.
Purpose: This FXML layout defines the user interface for a Login Screen in a game application:
-
Background and Styling: The background features a gradient color scheme from #169fd4 to #0174aa, and there are decorative ImageView elements showing animated GIFs and a chessboard image, which enhances the visual appeal. It uses a clean and modern aesthetic with rounded rectangles and soft drop shadows to give depth.
-
Login Form: The login form includes TextField for entering the username, PasswordField for the password, and buttons for submitting the login information and navigating to a sign-up or guest mode. The submit button has a pink color with shadow effects to make it stand out, and the design includes text labels for "Username" and "Password," both styled in the Press Start 2P Regular font.
-
Navigation and Interactivity: There are interactive elements such as buttons and StackPane components that allow users to switch between the login screen, game selection, and sign-up pages. Additionally, the layout includes a "guest" option for users to proceed without an account, enhancing the flexibility of the login process. The "Back" button is styled with a yellow background, providing easy navigation for the user.
Purpose: This CSS file is used for styling the Lose Screen in a game application:
-
Background: The screen background is set to a white color (#FFFFFF), with a night-themed image (night_popup.png) that repeats the background image to cover the entire screen. The image is positioned centrally to maintain focus.
-
Text Style (YOU LOSE): The text displaying "YOU LOSE" is styled with a bold, white font (#fff), using the Press Start 2P font. The font size is set to 14px, ensuring it stands out on the screen.
-
Buttons: The buttons on the loose screen are transparent with a light blue-grey text color (#A0B1C9) that changes to white (#FFFFFF) when hovered. The buttons are designed with the Press Start 2P font, offering a consistent retro gaming style. The buttons are also padded for better user interaction.
Purpose: This FXML file defines the layout and structure for the Lose Screen in a JavaFX application:
-
VBox Layout: The root layout is a VBox, which stacks the elements vertically with a center alignment and 15px spacing between them.
-
Label: A Label displays the message "YOU HAVE LOST!" with a custom style applied (lose-text), which is defined in the associated lose_styles.css file. The label is centrally aligned.
-
HBox Layout: Below the label, an HBox is used to horizontally arrange two buttons with 10px spacing between them:
- Main Menu Button: This button allows the user to return to the main menu when clicked.
- Start Over Button: This button allows the user to restart the game when clicked.
Both buttons are styled using the game-button class from the lose_styles.css file.
Purpose: This FXML layout is for a Match Type Selection screen in a JavaFX application, where the user can choose to either host a new game, join an existing game by entering a match ID, or go back to the home screen. Here's an overview of the structure and functionality:
This layout is centered around an engaging game selection interface with clear options for users to host or join games. The visual style is bright and retro, consistent with the game’s theme, and it's designed to be interactive and user-friendly.
Purpose: This FXML layout represents a popup menu in a game, likely used for actions like "Resign", "Request Draw", and "Cancel" during a match. Here's a breakdown of the structure and its functionality:
This layout makes the interface clean and functional, with large, easily clickable buttons and a retro game aesthetic that adds to the visual appeal and user engagement.
Purpose: This FXML layout represents a Multi-Factor Authentication (MFA) Popup interface where users can input their MFA code. It includes a Label prompting the user to enter the code, a TextField for input, and a Submit button to verify the code, styled with simple padding and font adjustments to enhance usability and clarity. The popup is centered and has a clean white background for a streamlined user experience.
Purpose: This FXML layout represents a Checkers game interface with a visually engaging design. It features a game board implemented using a GridPane filled with checker pieces, styled with images. The layout includes interactive elements such as menu, chat buttons, and labels for Player 1 and Player 2. The interface is set against a dynamic background with options for navigating to different game functions, providing an immersive user experience for the checkers game.
Purpose: This FXML layout is designed for a Chess game interface where a player can promote their pawn to one of four pieces: Knight, Bishop, Rook, or Queen. The interface is visually styled with a desert background and features a chessboard in the center, along with interactive buttons for pawn promotion. A pop-up appears when a pawn is promoted, offering choices for the user to select the new piece. The design also includes labels for Player 1 and Player 2, and navigation buttons like menu and chat for a comprehensive gaming experience.
Purpose: This FXML layout represents the user interface for a Checkers game with a forest-themed background and a checkered game board centered on the screen. The game board is embedded in a GridPane, where each cell is designed to hold an image of a checker piece, and the board is rotated to create a mirrored view for Player 2. The interface also includes a menu button and a chat button for game navigation, alongside labels showing the names of Player 1 and Player 2. The layout is visually structured for an engaging multiplayer game experience.
Purpose: This FXML layout represents the Checkers game interface for Player 2, featuring a desert-themed background and a blue checkered game board. The GridPane holds the game pieces, and it is rotated for Player 2's perspective. Additionally, there is a pawn promotion popup with buttons for choosing a Knight, Bishop, Rook, or Queen upon promoting a pawn. The interface also includes menu and chat buttons, as well as labels displaying the names of Player 1 and Player 2, providing an interactive and engaging gaming experience.
Purpose: This FXML layout is for the sign-up screen of a game, featuring a blue gradient background with images of twinkling stars and a chessboard. The interface includes text inputs for email, username, and password, each with distinct rounded text fields and a submit button. There's also a back button to return to the home screen, a login prompt for users who already have an account, and a guest login option for those who wish to play without creating an account. The design uses retro-style fonts and drop shadows to enhance the visual appeal, giving the UI a playful, game-like feel.
Purpose: This FXML layout represents the start screen for a game with a retro aesthetic. It features a gradient blue background and includes several animated and static images like twinkling stars and a chessboard, setting the stage for an interactive experience. Prominent on the screen is a large "ONLINE MULTIPLAYER BOARD GAME" text in a retro font, paired with images of game pieces like a purple knight and a white rook.
Purpose: This class defines the styling for the win screen of a game. It sets a cloud-themed background with a retro font ("Press Start 2P") for text elements. The "YOU WIN" text is styled with a bold gold color, while the buttons are given a transparent background with subtle hover effects that change the text color to provide an interactive experience.
Purpose: This FXML layout defines the interface for a Tic-Tac-Toe game screen, featuring a mountain and star background with a central game grid where players can click to place their marks. It includes player name labels at the top, a menu button for navigation, and a chat button for communication, along with interactive elements such as clickable grid cells to play the game. The design is enhanced with image effects and custom fonts for a retro aesthetic.
Purpose: This FXML layout defines a stylish menu popup for a game interface with a TetrisCat theme. The design features a background gradient, a central container with the TetrisCat logo, and interactive elements such as a "SOS" button and a catchphrase beneath the cat icon. It also includes subtle effects, like drop shadows and gradient borders, to create an engaging and visually appealing user interface.
Purpose: This FXML layout defines a user profile interface featuring an interactive tab pane where users can view their overview, match history, and friend list. The profile is visually enhanced with elements like a gradient background, shadow effects, and circular avatars, while the match history is displayed with a scrollable list of past games, showing win/loss/draw results, opponent names, and game statistics. This design provides a sleek and engaging way to manage and view user data in a game interface.
Purpose: This FXML layout defines a user settings page with a profile editor, allowing users to customize their display name, password, and privacy settings. The page features a dual-column design, with a left panel displaying the user's avatar and bio, and a right panel containing editable fields for the user’s credentials, privacy toggles for stats and friend visibility, and buttons for changing the avatar and banner. The layout combines a retro gaming style with vibrant colors, rounded corners, and a clean, user-friendly interface.
Purpose: This FXML layout defines a win screen for a game, featuring a central "YOU WIN!!" label in a bold, styled font, with two buttons positioned below. The buttons allow users to either return to the main menu or restart the game. The layout uses a VBox to arrange the elements vertically with some spacing, and a HBox to place the buttons side by side, all styled through an external CSS file for a consistent, polished look.
Purpose: This Java class defines the AdminController for managing an admin interface in a JavaFX application. It includes functionality for an administrator to interact with user data by finding, deleting, and updating user information, as well as clearing user stats. The application integrates FXML for the UI and JavaFX for scene management, transitioning, and event handling. There are placeholders for database interaction (such as querying user accounts and updating information), but the actual database connection and logic need to be implemented. Additionally, the AdminController uses custom transitions for button interactions and loads a custom font for the UI.
Purpose: The Connect4Controller class is a JavaFX controller for managing the logic and user interactions in a Connect4 game application. It includes functionality for handling user input (e.g., clicking on columns to drop pieces), updating the game board, and switching between game states such as win, draw, or continuing the game. The class also manages visual elements like showing the player's piece and handling animations for hovering over columns, as well as integrating with the main menu and chat functionality. The game is initialized, and transitions are set up for user interaction, such as displaying a hand animation when hovering over columns to place pieces.
Purpose: The DrawScreenController class is responsible for managing the actions on the "Draw Screen" in a JavaFX application, such as handling the "Start Over" and "Main Menu" button events. When the user clicks on these buttons, the class either restarts the game or navigates back to the main menu by switching the scene. It uses the SceneManager class to manage scene transitions and includes basic event handling and stage manipulation.
Purpose: The GameSelectController class manages the game selection screen in a JavaFX application. It allows users to select different games (Connect 4, TicTacToe, Chess, Checkers), displays a waiting popup when a game is chosen, and handles scene transitions to the respective game screens. The class also includes an animation feature that updates the waiting message with dots to indicate that the player is waiting for a match, and it provides buttons for navigation to the user profile and leaderboard screens.
Purpose: The HelpController class handles the help screen functionality in a JavaFX application. It displays a help popup when triggered, allowing users to access help content, and includes functionality to close the help window when the user clicks the close button. The class also defines the main method to launch the application and sets up the scene for the help screen.
Purpose: The LeaderboardController class manages the functionality of a leaderboard screen in a JavaFX application, allowing users to view game leaderboards based on different criteria like ELO, win rate, and additional statistics. It enables the selection of different game types, sorting options, and views (global or friends-only), and populates a table with leaderboard data. The class also provides error handling for situations like when a user is not logged in and includes methods for changing the leaderboard display and interacting with various UI components.
Purpose: The LoginController class manages the login functionality in a JavaFX application, handling user authentication via username and password. It interacts with a database to verify the user's credentials, and upon successful login, triggers Multi-Factor Authentication (MFA) through a popup. The class also provides navigation between screens, including switching to the game selection screen or admin panel based on user credentials, and managing UI elements like buttons and text fields.
Purpose: The LoseScreenController class manages the functionality of the loss screen in a JavaFX application. It provides two buttons: one for restarting the game and another for navigating to the main menu. When the user clicks either button, the appropriate action is triggered, such as restarting the game or returning to the main menu, using scene transitions managed by SceneManager.
Purpose: The Main class is the entry point for the JavaFX application, which manages the initialization and display of the primary stage. It registers the starting screen using SceneManager.registerScenes("/screens/Start.fxml"), then loads and shows a modal pop-up (like DrawScreen, WinScreen, or LoseScreen) using FXMLLoader and Stage to create a separate window that blocks interaction with the main window until closed. The modal window's purpose is to display the outcome of a game before the user can interact further.
Purpose: The MatchmakingHandlerWatcher class is a background thread responsible for monitoring the matchmaking process in a game. It continuously checks the MatchmakingHandler's state and, once a match is found, retrieves relevant game and player data to start the game UI using the provided MatchTypeController. The thread pauses for one second between checks to avoid overwhelming the system, ensuring smooth operation during matchmaking.
Purpose: The MatchTypeController class manages the user interface and functionality for selecting and hosting games in the application. It handles the display of game types (e.g., Chess, Checkers, TicTacToe, Connect4), allows players to either host a game or join an existing match using a room code, and facilitates matchmaking between players. Additionally, it manages the UI transitions between the game selection screen and the individual game screens, and it integrates the matchmaking process using the MatchmakingHandler.
Purpose: The MenuPopupController class is responsible for managing the popup menu during gameplay. It handles the display and functionality of buttons like close, draw, and resign, allowing users to interact with the game during a match. The class also manages the opening and closing of the popup window, including setting up the appropriate scene, fonts, and styles for the game.
Purpose: The P1CheckersController class handles the gameplay logic for the first player in a checkers game. It manages player turns, updates the board, and controls game events such as moves, draws, or wins. It also interacts with the user interface, displaying the correct images for checkers pieces and updating labels to reflect the current player's turn.
Purpose: The P1ChessController class is responsible for managing the gameplay logic of the first player in a chess game. It handles user input, such as moving pieces, and updates the game board accordingly, reflecting the changes on the graphical interface. Additionally, it includes logic for pawn promotion and ensures that each player's turn and piece movements are displayed correctly, while also managing the interaction with the game's UI components.
Purpose: The P2CheckersController class manages the second player's interactions in a checkers game. It updates the game board by reflecting each player's moves and handles the game state, including checking for a win, draw, or ongoing turns. The controller allows for piece movement, updates player labels for turn tracking, and facilitates gameplay events like drawing or resigning. It also includes functionality for initializing the game board and managing UI interactions such as showing popups and managing chat features.
Purpose: The P2ChessController class manages the second player's interactions in a chess game. It updates the chessboard by reflecting each player's moves, handles piece promotions for pawns reaching the opposite end, and checks for game outcomes such as a win or draw. The controller handles piece movement, pawn promotion, game state updates, and player turn indicators, while also managing UI elements like piece images, player labels, and interactions with game popups.
Purpose: The SceneManager class handles the management of scene transitions in a JavaFX application. It registers scenes by their FXML paths and provides a method to switch between scenes with smooth fade-in and fade-out transitions. The class ensures that when switching scenes, the current scene fades out before transitioning to the new one, enhancing the user experience.
Purpose: The SignUpController class is responsible for handling the sign-up process in a JavaFX application. It provides functionality for users to input their email, username, and password to create a new account. The class includes form validation, account creation logic, and navigation to other screens like the login page or game selection page after successful account creation.
Purpose: The StartController class manages the start screen of a JavaFX application, where users can navigate to different options such as the sign-up page, leaderboard, and help section. It handles the visual setup, including loading a GIF background and setting the window title, while providing functionality to switch scenes (like to sign-up or leaderboard). Additionally, it includes animations for interactive buttons and integrates external resources like fonts and images for a dynamic user experience.
Purpose: This is a CSS file for styling a JavaFX application, primarily focusing on creating a retro, pixelated aesthetic using custom fonts like "Press Start 2P" and "Pixelite." It defines hover animations for buttons and elements (such as loginHoverButton and hoverCartridge), ensuring smooth transitions. The stylesheet also customizes tab headers, scroll bars, labels, and other UI components to match the overall theme, including transparent backgrounds and consistent font usage for headers and subheaders. Additionally, the styling incorporates subtle animations and visual effects to enhance the user experience, such as scaling and translating on hover.
Purpose: This class, TicTacToeController, is responsible for managing the game logic and user interface for a Tic-Tac-Toe game in a JavaFX application. It handles user interactions such as clicking on the grid to make moves, switching turns between players, updating the board with X and O symbols, and checking for win conditions. The class also manages the visual appearance of the game by updating labels, controlling the visibility of pieces, and handling UI transitions between game states.
Purpose: This class, UserProfileController, manages the user profile interface in a JavaFX application. It handles the display of user information, such as the username, avatar, and stats, while providing navigation to different sections such as matches and settings. The class also integrates UI interactions like hover effects on profile panes and a popup for user actions, using transitions to enhance the visual experience.
Purpose: The UserSettingsController class is a simple JavaFX application that initializes and displays the user settings screen. It loads the UI layout from an FXML file, sets the window size, and displays it with the title "User Settings." The class is responsible for launching the application and rendering the settings interface.
Purpose: The UtilityManager class provides a set of utility methods for adding animations and hover effects to various UI components in the application. These methods include functionality for scaling buttons, translating items, changing text colors on hover, and displaying popups. It also handles events like opening help popups, controlling chat, and offering smooth visual transitions for user interactions with elements like game cartridges, text labels, and user profile panes.
Purpose: The WinScreenController class manages the UI behavior for the "You Win" screen in the application. It handles user interactions such as restarting the game or navigating to the main menu when the respective buttons are clicked. The handleStartOver method currently outputs a message to the console, and the handleMainMenu method switches the scene back to the start screen, using the SceneManager to facilitate the transition.
- Account
- Checkers
- Chess
- Connect 4
- Database
- Leaderboard
- Match Making
- Match Outcome
- Networking
- Statistics
- Tic Tac Toe
Purpose: The AccountTest class contains unit tests for the Account class, validating functionalities such as account initialization, account updates, friend management, and game statistics tracking. It tests methods like converting a guest account to a user account, updating user details, adding/removing friends, and updating Elo ratings. Additionally, it ensures the integrity of match history logging, queueing systems, and various other user account features, asserting correct behavior and error handling in different scenarios.
Purpose: The CheckersTest class is a suite of unit tests for the Checkers game implementation. It includes tests for various gameplay scenarios such as board setup, piece movement, valid and invalid captures, forced captures, king promotions, win conditions, and turn switching. Each test case ensures that the Checkers game logic correctly handles different aspects of gameplay and edge cases, such as multiple captures and player surrender.
Purpose: The ChessTesting class contains unit tests for various methods in the Chess game. It includes tests for scenarios like checkmate detection, pinning pieces, castling attempts, and checking if the king is in check but not in checkmate. Each test validates specific game mechanics, such as verifying if the player is in check, handling piece movements, and ensuring the correct game outcomes based on the board state.
Purpose: The Connect4Testing class is a JUnit test suite that verifies the functionality of a Connect4 game. It contains multiple test methods, each focused on checking different win conditions, such as winning in a column, row, and diagonal directions. The tests ensure that the game's logic for detecting victories in various orientations is working correctly by simulating moves and asserting the expected outcomes.
Purpose: The DatabaseConnectionTest class tests the database connection, verifying successful connections, handling errors, and ensuring proper closure. The DatabaseManagerTest class checks the functionality of saving and retrieving user accounts, including account attributes like username and email. Both tests ensure a clean environment by resetting the database before each test.
Purpose: The LeaderboardTest class tests the Leaderboard class functionality by simulating mock accounts and verifying the correct sorting and pagination of global leaderboard data. It includes tests for sorting by Elo ratings and wins, ensuring the leaderboard displays correct rankings and player statistics. The class also checks for proper pagination by verifying that the correct number of accounts are displayed per page.
Purpose: The MatchmakingTest.java class tests the matchmaking system by verifying the functionality of queue joining, player compatibility, and Elo rating-based matching. It ensures that players are correctly added and removed from the queue and that matchmaking returns expected results. The PrivateMatchTest.java class tests the creation and management of private matches, including player joining, leaving, and the behavior when the host leaves the match.
Purpose: The MatchOutcomeHandlerTest.java class is a test file that sets up test data for simulating match outcomes between two players in a game. It includes the initialization of Account objects for both players and the associated statistics using a HashMap. The file is designed to test the handling of match outcomes, though specific test methods are not yet implemented.
Purpose: These test classes cover a variety of game-related functionalities. They include tests for database connections, matchmaking, player actions, and chat systems, ensuring each part of the game operates correctly. Additionally, they verify that game outcomes, private matches, and leaderboards work as expected.
Purpose: The StatisticsTicTacToeTest class is a set of unit tests for the StatisticsTicTacToe class, focusing on verifying the correct behavior of game statistics. It includes tests for default constructor values, custom constructor overrides, updating Elo ratings, adding statistics, and calculating the win rate. Each test ensures that the StatisticsTicTacToe methods return the correct values and maintain consistency across different game states and statistics.
Purpose: The TicTacToeTesting class tests the functionality of the Tic-Tac-Toe game, focusing on the moves and win conditions for both players. It includes multiple test methods to check valid and invalid placements, winning conditions for rows, columns, and diagonals, and game state changes such as draw or surrender scenarios. Additionally, it tests the game's turn progression using the nextTurn method, ensuring proper alternation between players and correct handling of game states.
- assets
- all.css
- checker.css
- checkers.html
- checkers.js
- chess.css
- chess.html
- chess.js
- connect4.css
- connect4.html
- connect4.js
- help.css
- help.html
- index.css
- index.html
- login.css
- login.html
- login.js
- scripts.js
- signup.css
- signup.html
- signup.js
- store.css
- store.html
- store.js
- tictactoe.css
- tictactoe.html
- tictactoe.js
Purpose: All sprites and Screen used for the website. omgame.club
Purpose: This CSS file provides consistent styling for the web application, including smooth scrolling, interactive button effects, and popups. It also defines the layout for key elements such as headers, footers, and chat interfaces with animations and hover effects. The file enhances the user experience with visually appealing transitions, scalable buttons, and modals for improved navigation.
Purpose: This CSS file styles a chessboard layout with alternating light and dark squares, defining their size, grid structure, and piece placement. It includes interactive elements like buttons and highlighted squares with hover effects for a more engaging user experience. The overall design ensures a clean, modern look with smooth transitions and easy navigation.
Purpose: This HTML document sets up a tutorial page for checkers promotion and capture, including a navigation bar with links to the home, help, and store pages. It features a checkers board interface with a "Reset Board" button, and an overlay popup for additional guidance or SOS alerts. External CSS and JavaScript files are linked to style the page and manage game interactions.
Purpose: This JavaScript class sets up a checkers tutorial game, allowing the player to interact with the board, move pieces, and capture the opponent's pieces. It includes game logic for piece movement, promotion to a king, and enemy AI movement, while also providing visual feedback through popups and highlights. The game is interactive, with a responsive design that includes a reset function and user-specific login display.
Purpose: This CSS class defines the layout and style for a checkers game tutorial page, including the board, pieces, and interactive elements. It provides a clean, responsive design with smooth transitions for the game board and action buttons. The buttons have hover effects, and the board and pieces are styled for an engaging user experience, with hover highlights and a popup feature for interactive guidance.
Purpose: This HTML file provides the structure for a Chess tutorial page, including a header, informational sections about chess pieces and movements, and a chess board for interactive play. It also features a popup with a Tetris Cat GIF and SOS message for tutorial assistance, and buttons to start the tutorial or reset the game. The page includes external CSS and JavaScript files for styling and functionality, enhancing the user experience with smooth interactions and game reset capabilities.
Purpose: This JavaScript code implements a chess tutorial game that walks the user through basic chess movements and strategies. It includes functions to create and manage a chessboard, handle piece movements, and provide instructional popups at various stages of the tutorial. The tutorial progresses through phases, such as pawn movement, promotion, and checkmate strategies, while updating the board and guiding the user through capturing and moving pieces.
Purpose: This CSS defines the styling for a Connect Four game interface. The layout consists of a 7x6 grid where each cell is styled to appear circular with a subtle inner shadow, and each piece in the game is represented by a circle with color transitions for the red and yellow discs. Additional styles enhance the visual appearance with rounded corners, shadows, hover effects on buttons, and smooth transitions for moving the pieces.
Purpose: This HTML file sets up the basic structure for a Connect Four game. It includes a header with navigation links, a dynamic board for the game, a button to reset the game, and a popup container for tutorials or messages. The page links to external stylesheets and JavaScript files to manage the game's appearance and functionality, with a special popup for additional interactions.
Purpose: This JavaScript file handles the logic for the Connect Four game. It initializes the game board, handles user and AI moves, checks for a vertical win, and provides a popup tutorial or feedback on the current state of the game. The file also manages the interactivity of the board, enabling and disabling columns for moves, and updating the UI accordingly.
Purpose: This CSS file styles the "Help" section of the website, creating a clean and user-friendly interface for displaying help content. It includes responsive, grid-based layout for help cards, with interactive hover effects on the cards and buttons. The design utilizes soft colors and shadow effects to create a modern and approachable appearance.
Purpose: This HTML file provides the structure for a "Help" page, offering instructions for various games such as Chess, Checkers, TicTacToe, Connect4, Tetris, and Monopoly. It includes interactive cards for each game, a "Coming Soon" popup for games still in development, and a chat support feature. The page uses smooth transitions, popups, and a fixed chat button to enhance user experience.
Purpose: This CSS file styles a webpage with a visually striking layout, including a hero section with a gradient background, large heading, and call-to-action button. It also defines styles for a "vision" section with a background image, as well as cards and grids for displaying content in a clean, responsive format. Hover effects are added for interactive elements, enhancing the user experience with smooth transitions and scaling effects.
Purpose: This HTML page serves as the homepage for the Online Multiplayer Games (OMG) platform, providing an introduction to the site and its core features. It includes a hero section with a call-to-action, various feature cards highlighting key platform benefits, and a section outlining the platform's vision. The page also integrates a live chat support feature, a popup for help requests, and various animations to enhance user engagement.
Purpose: This CSS styles a clean and modern login page with a gradient background and a centered login card. The login card includes input fields for username and password, a password visibility toggle, a submission button with hover effects, and sections for error and success messages. It also features a back button and responsive design elements for a user-friendly login experience.
Purpose: This HTML structure represents a login page for the "Online Multiplayer Games - OMG" platform. It includes a form where users can input their username and password, with a toggle feature to reveal or hide the password. The page also features a back button, a login button, a message area for feedback, and a link for users to sign up if they don't have an account.
Purpose: This JavaScript code handles user authentication for the login page, allowing users to sign in with their credentials stored in localStorage or default data. It supports the visibility toggle for the password field and provides feedback messages on login success or failure. Additionally, it checks if the user is already logged in, displaying a personalized greeting and logout option, while allowing users to log in by pressing the "Enter" key.
Purpose: This JavaScript code manages the chat interface and a scrolling progress bar. It tracks the user's scroll position and updates the scroll progress bar width accordingly. Additionally, it handles the display and interaction of a chat popup, allowing users to send messages, receive automated bot replies, and toggle the visibility of the chat. The script also manages the user login state, displaying the logged-in user's name if available.
Purpose: This CSS styles a user login page with a clean, modern design. It defines a card layout for the login form, with input fields, buttons, and a password toggle feature. The styling includes hover effects, background gradients, and responsiveness, ensuring a user-friendly and visually appealing experience.
Purpose: This HTML page is for a user sign-up form, allowing users to create an account on the Online Multiplayer Games (OMG) platform. It includes fields for choosing a username, entering an email, and setting a password with confirmation. The form features password strength checking, terms acceptance, and a toggle to show or hide the password fields, along with a link to the login page for existing users.
Purpose: This JavaScript code manages the sign-up process for users, including validating input, checking password strength, and handling user data storage. It checks that all fields are completed, validates the email format, ensures the passwords match, and confirms agreement to terms before saving the user's information to local storage. The script also supports toggling the visibility of the password and handles the "Enter" key to submit the form for a smoother user experience.
Purpose: This CSS defines the styling for an online store interface, with a responsive grid layout for items, tabbed navigation, and modal windows for item purchases. It includes hover effects, transition animations, and a consistent design for buttons, cards, and modals. Additionally, it styles a dynamic Stripe payment modal and ensures an interactive user experience with various visual feedbacks such as scaling effects and highlighted elements.
Purpose: This HTML code structures the "Store" page for an online multiplayer game platform, featuring sections for Loot Boxes, Ranks, and Skins. It includes interactive elements such as a modal for item viewing, a chat popup for support, and a fake Stripe payment modal for processing payments. The page also features tab navigation, a responsive grid layout for product display, and buttons for purchasing items or learning more about them.
Purpose: This JavaScript code handles the logic for a store page, including interactions with the Stripe payment modal, product modals, and tab navigation. It enables users to view product details, select quantities, and process payments with a modal interface. Additionally, it handles the dynamic updating of prices based on quantity, ensures the correct modal is displayed, and provides validation for custom quantity inputs and payment processing.
Purpose: This CSS style is designed for a Tic-Tac-Toe game interface. It creates a responsive grid layout for the game board, with stylized cells that change appearance when hovered over or clicked. It also defines styles for the buttons and interactive elements, with hover effects for better user interaction, and a .disabled class for inactive cells.
Purpose: This HTML structure sets up the layout for a Tic-Tac-Toe game. It includes a header with navigation links, a dynamic board for the game, and a "Reset Board" button. Additionally, there is a popup box that provides in-game messages, such as game instructions or alerts.
Purpose: his JavaScript code sets up and controls a Tic-Tac-Toe game. It generates a board, allows the user to make moves by clicking on cells, and handles game logic, including win conditions. It also enables a popup system to guide users and display game progress, such as instructions and results.
Purpose: The list of everyone's commits to the project.
Purpose: The link of the gitlab repository.
Purpose: Everyone who worked on the project with the names and UCID.
