How famisics/processing-game works
Main Components
• Game Client (Processing Application): This is the core game logic, including various scene files (scene1_Home.pde, scene2_Block.pde, …, scene7_Username.pde), input management, and other modules (e.g., Manager.pde, Network.pde). Additionally, there are unit files (unit_Ball.pde, unit_FPS.pde, unit_skill.pde) and virtual logic files (vLogic_Panel.pde, vLogic_Skill.pde, vLogic_block.pde) that handle specific gameplay mechanics.
• Assets and Configuration: Under the /game/src/ folder, you have configuration files (config.json, skills.csv), as well as assets like fonts, images, and sound files. This supports dynamic configuration (e.g., skill adjustments) and media resources used within the game.
• Launcher and Node-based Components: Two distinct Node.js server components exist:
• The node-launcher inside /game/src/node-launcher contains the source code for launcher.exe, which provides functionality to start the game and potentially handle some pre-launch configuration or network initiation.
• The node-proxy folder contains a standalone Node.js proxy server (with its own package.json and server.cjs) that mimics the functionality of launcher.exe and enables users on macOS or Linux to run the game by starting a proxy that manages network connections.
• Distribution Build: The /dist/ folder holds production executables (such as launcher.exe) which are built from the source.
Relationships and Interactions
• The Game Client is the central piece where the gameplay occurs. It loads configurations and assets at startup and executes various scenes and game logic.
• When multiplayer functionality is enabled (i.e., NET_isNetworkEnable set to true), the game client establishes a connection to the external public server via WebSocket (hosted with Render using node.js/express). In parallel, either launcher.exe (from /dist/) or the node-proxy server provides an interface to manage this connection.
• Assets and configurations are loaded by the game client from the game/src directory, ensuring that fonts, images, sounds, and game parameters (like skills) are dynamically available.
Architectural Patterns and Technologies
• Separation of Concerns: The project is split between the game logic (Processing code for scenes, units, and virtual logic) and the auxiliary Node.js servers (launcher and proxy) that handle networking.
• Client–Server Architecture: A clear division exists between the game client (which does rendering and game state management) and the server components (which manage multiplayer networking, using technologies such as WebSockets, Express, and Node.js).
• Resource Management: The use of directories for assets (fonts, images, sounds) reflects a modular approach for easy content management and scalability.