How tropicbird/mcp-demo-cursor works
Main Components
• Game UI & Entry Point: Represented by index.html. This is where users access the game and start the interaction.
• Game Logic & Interaction: Found in apple/js/main.js. This component contains the scripts that handle user input (tap/click) and game mechanics (tracking rotations, time limits).
• 3D Assets: The apple folder holds the 3D model files such as apple.gltf and apple.bin. These files are loaded and rendered using three.js.
• 3D Engine Library: The lib directory contains the three.js library, along with multiple example modules (e.g., OrbitControls, GLTFLoader, BufferGeometryUtils) that enable loading the 3D assets, camera controls, and scene management.
• Development/Automation Configurations: The .cursor directory includes rules (my-github-rule.mdc and my-slack-rule.mdc), which are used to automate GitHub pull request notifications to Slack. These components are part of the continuous integration or notifications pipeline.
Relationships and Interactions
• The UI (index.html) initializes the game and manages the overall layout and responsiveness for mobile devices.
• When the game starts, the JavaScript in apple/js/main.js is executed. This script calls functions from the three.js library (loaded from lib/three) to set up the 3D scene.
• The game logic uses three.js components (for instance, OrbitControls and GLTFLoader) to load the apple assets and to capture user input (clicks or taps) that cause the apple to rotate.
• The animation and rotation count logic run entirely on the client side.
• Parallelly, for development and deployment, the .cursor rules are used to automate handling issues and notifying via Slack once pull requests are made on GitHub.
Architectural Patterns & Design Principles
• Frontend-Centric Architecture: This project is structured as a monolithic client-side application with clear separation of concerns between UI, game logic, and rendering.
• Modularization: Although it is a simple game, modules are separated into directories (apple for assets and game logic, lib for external libraries) which indicates an effort toward clean organization.
• Integration of Third-Party Libraries: The extensive use of three.js and its helper modules is central to the project’s interactive 3D rendering.
• Development Workflow Automation: The inclusion of .cursor rules shows an aspect of DevOps, where notifications and issue tracking are built into the development process.