How leweyg/freedgames works
Project Type and Purpose
• This repository houses two related projects—Freed Go and Shuzzle—each provided in two incarnations:
a. A modern, pure client-side JavaScript/WebGL (three.js) “v2” web app under docs/
b. A “v1” C++ OpenGL/GLUT desktop implementation under cpp/ (and mirrored in v1/ JSON assets)
• Both web apps are static sites (HTML/CSS/JS), served from a CDN or static host, which connect to a Google-based backend for cloud storage and real-time multiplayer.
File-Structure Analysis
Top level:
• cpp/Shuzzle/Shuzzle/… → The complete C++ legacy codebase (core logic, rendering via GLUT/OpenGL, OS bindings, IO, networking)
• docs/FreedGo/… & docs/Shuzzle/… → HTML, CSS, JS for the v2 web clients
• v1/… → JSON asset exports of boards/puzzles and a copy of the C++ code for reference
• Static root files: index.html, README.md, LICENSE
README Insights
• Confirms static, client-only JavaScript apps using embedded three.js
• Mentions “Google server” for cloud-storage and multiplayer room management
• Legacy C++ code used as reference, with board definitions exported in JSON
a. Main Components
1. Static Web Host
• Serves docs/ content (HTML/CSS/JS & JSON assets)
2. Web Client (browser)
• Presentation Layer: index.html + main.css
• Renderer: three.js engine
• Game Logic: freed_go.js or shuzzle_core.js + game modules (FreedGo boards loader, puzzle logic, UI controls)
• Data Layer: JSON board/puzzle definitions (docs/.../*.json)
• Network Layer: JS code invoking Google REST/WebSocket APIs
3. Cloud Backend (Google)
• Authentication & user/session management
• Real-time database or pub/sub for multiplayer rooms
• Cloud storage for saved games
4. (Legacy) Desktop C++ App
• Core: GoGame.cpp / ShuzzleGame.cpp + core modules (Board, Utils, matrixclass, pnt, gennet)
• Graphics: GoCore_GLUT.cpp, ShuzzleCore_GLUT.cpp, etc.
• OS Binding: OSBinding*.cpp for Win32, SDL, GLUT
• I/O & Networking: IOUtils.cpp, LCNet.h
b. Relationships and Interactions
• Browser ←→ Static Host: HTTP GET for HTML/CSS/JS and JSON assets
• Browser ←→ Google Backend: REST or WebSocket calls for cloud storage & multiplayer sync
• JS Game Logic invokes three.js for rendering each frame
• Legacy C++ app is standalone: event loop → render via OpenGL → user input via GLUT/SDL → optional LCNet for network
c. Architectural Patterns & Design Principles
• Web version: Client-Side MVC/MVVM
• Model: JSON boards + in-memory game state
• View: three.js scene graph + DOM UI
• Controller: input handlers + game logic modules
• Clear separation of concerns: rendering (three.js) vs. logic (game modules) vs. data (JSON) vs. network
• Static hosting plus thin client—no custom backend code in this repo
• Legacy desktop: modular C++ code layering core logic, graphics, OS binding, networking
d. Key Technologies
• three.js (WebGL rendering)
• Plain JavaScript modules (no bundler shown)
• JSON for board definitions
• Google Cloud services (likely Firebase Realtime Database or Firestore + Auth)
• C++17 (or earlier) with OpenGL/GLUT, SDL, Win32