How saon110/u_and_not_u works
Main Components
a. HTML & Styling Layer:
• index.html – Acts as the entry point and sets up the canvas where the game runs.
• style.css – Contains all the styling rules for the game’s UI elements.
b. Game Logic & Rendering (p5.js):
c. Game Entities (Classes):
• classes/player.js, enemy.js, greenball.js, redball.js – These files define the behavior and properties of various game entities (player, enemies, and other objects). They encapsulate functionality to support movements, collisions, and interactions.
d. Configuration/Development Support:
• jsconfig.json – Likely aids in code configuration or module resolution for the JavaScript environment, helping with autocompletion and proper integration of the project’s modules.
Out the Relationships and Interactions
a. index.html is the starting point that loads both style.css for visuals and libraries/sketch.js, initiating the p5.js game loop.
b. Within sketch.js, the game is initialized, and key objects (player, enemy, balls, etc.) are instantiated by calling constructors from the respective files in the classes directory.
d. p5.js functions interact with both the visual (canvas rendering) and logical (game state update) aspects, ensuring animations and interactions are smooth.
Incorporate Architectural Patterns and Design Principles
a. Separation of Concerns:
• UI/rendering is handled separately by the HTML/CSS layer.
• Game logic and state management reside in the p5.js based sketch.js and individual class files.
b. Modularization:
• Different game components and behaviors are modularized into separate JS class files.
c. Reusability and Extensibility:
• The distinct classes (player, enemy, greenball, redball) suggest that the project was designed to easily extend or modify behaviors for diverse game objects.