How amgt2302/air-platformer works
Project type and purpose
• AirPlatformer is a lightweight, full-stack web application: a real-time, multi-device platformer game.
• The “backend” is a single Node.js process (Server.js) that serves static front-end assets and hosts a WebSocket server.
• The “frontend” consists of two browser‐based clients:
• The “Controller” UI (controller.html + controller.js)
• The “Game” UI (game.html + game.js)
File structure
• Root:
• Server.js – Node.js entrypoint that both serves files over HTTP and handles WebSocket connections
• package.json/lock – Node dependencies (express, ws, etc.)
• public/ – all static assets
• HTML pages: index.html (landing), controller.html, game.html, setting.html
• public/JS: main.js (shared logic/bootstrap), controller.js, game.js, setting.js
• public/styles & style.css – CSS for each page
• public/asset – images and GIFs
README for additional insights
• Describes real-time multiplayer via WebSockets
• Two distinct client roles (controller vs. game screen) communicating through the server
• No external database—game state is managed in memory or on the clients
Detail without over-splitting
• Distinct role (landing page vs settings vs game) only if it adds clarity
• Real-time message flow (Pub/Sub WebSocket) as the core differentiator
[Controller Browser]
| HTTP GET /controller.html, JS, CSS
V
[Node.js HTTP Server]
|
+-----------------------------+
| |
V V
Serves static assets [public/JS, public/styles, assets]
|
|
WebSocket Upgrade
|
V
[Node.js WebSocket Server]
^ ^
| broadcasts | broadcasts
| events | events
| |
[Controller] ---> Server ---> [Game]
WS WS UI
^ <-----<-----<-----------<