How wayou/t-rex-runner works
Main components
• Browser UI Layer – represented primarily by index.html which serves as the entry point.
• Presentation Layer – index.css defines the styling and layout.
• Game Logic / Engine – index.js contains the JavaScript game logic controlling animations, mechanics, and interactions.
• Assets – The assets directory (with subdirectories like default_100_percent and default_200_percent) holds images, sprites, and animated GIFs used in the game and promotional screenshots.
Determining relationships and interactions
• The browser loads index.html, which links to index.css for styling and index.js for functionality.
• index.js, once executed, dynamically loads assets (images/sprites) to render the game and handle animations/events.
• User interactions (such as key presses) are captured by the game logic (index.js), which updates the game state accordingly and manipulates the DOM (provided by index.html).
• There is no backend service or API, so the communication is entirely within the client side.
Highlighting architectural patterns and principles
• Separation of concerns is clearly maintained by splitting HTML (structure), CSS (presentation), and JavaScript (logic).
• The game is designed as a single-page application where all code runs in the client’s browser.
• Although simple, the design can still be mapped as “Input (user interactions) → Game Engine (index.js) → Rendering (DOM updates, CSS styles)” with resource loading.
Relevant technologies and frameworks
• HTML, CSS, and JavaScript are the core technologies.
• No external frameworks or libraries are evident from the file tree – the game is self-contained.
• Asset management is handled through organized folders for different resolutions, providing flexibility for different display environments.
Essential element details
• That the project follows a front-end-only architecture with a clear separation of concerns.