GoBang

GoBang Project

πŸ“ Project Overview

GoBang is a JavaScript-based Gomoku (Five in a Row) game offering:

This project demonstrates modern frontend techniques combined with a Node.js backend to manage AI computations and game state.


πŸš€ Features


πŸ› οΈ Tech Stack

Frontend

Backend

Development Tools


πŸ“‚ Project Structure

GoBang/
β”œβ”€β”€ app.js              # Backend server entry point
β”œβ”€β”€ db.js               # PostgreSQL database connection
β”œβ”€β”€ package.json        # Project metadata and dependencies
β”œβ”€β”€ public/             # Main frontend directory
β”‚   β”œβ”€β”€ index.html      # Main game interface
β”‚   β”œβ”€β”€ login.html      # Login page
β”‚   β”œβ”€β”€ offline-mode.html # Offline multiplayer mode page
β”‚   β”œβ”€β”€ styles.css      # General styles
β”‚   β”œβ”€β”€ login.css       # Specific styles for login page
β”‚   β”œβ”€β”€ index.js        # Main frontend logic
β”‚   β”œβ”€β”€ login.js        # Logic for login page
β”‚   β”œβ”€β”€ offline-mode.js # Logic for offline multiplayer mode
β”‚   β”œβ”€β”€ uploads/        # User-uploaded files
β”‚       └── avatars/    # Uploaded user avatars
β”œβ”€β”€ server/             # Backend logic directory
β”‚   β”œβ”€β”€ ai.js           # AI core logic
β”œβ”€β”€ src/                # Media files
β”‚   β”œβ”€β”€ piecedown.mp3   # Sound effect for placing a piece
β”‚   β”œβ”€β”€ rockwin.wav     # Sound effect for black's victory
β”‚   β”œβ”€β”€ choirwin.wav    # Sound effect for white's victory
β”‚   └── default-avatar.jpg # Default user avatar
| ... statics

πŸ“˜ Usage

Play the Game

  1. Single-Player Mode:
    • Click on the board to place a piece. The AI will respond with its move.
  2. Local Multiplayer Mode:
    • Take turns with a friend to play on the same device.
  3. Undo a Move:
    • Click the β€œUndo” button to revert the last move.
  4. Restart the Game:
    • Choose β€œRestart as Black” to restart the game with the player as black.
    • Choose β€œRestart as White” to restart the game with the player as white.
    • All user information (e.g., Max Streak, Win Rate) will reset and update accordingly.
  5. Display User Stats:
    • View Max Streak, Total Games, Win Rate, and other statistics, which dynamically update based on gameplay.

## 🎯 Roadmap


πŸ“ˆ Code Statistics

Note: These counts exclude empty lines for a more accurate measure of code content.

🀝 Contribution

Welcome all contributions! Please submit a Pull Request or report any Issues.


πŸ“„ License

This project is licensed under the MIT License.