Skip to main content
This page documents how assets are organized and managed in the R-Type project. Assets include graphical sprites, sound effects, animations, and fonts, which are essential for building an engaging game experience.

Asset Organization

All assets are stored in the root assets/ folder, and they are divided into subdirectories to separate different types of assets:

Folder Structure:

Explanation:

  • sprites/: Contains all images used as game sprites.
  • sounds/: Includes sound effects such as explosions, background music, and UI sounds.
  • fonts/: Stores font files required for rendering text.
  • shaders/: Contains vertex and fragment shader files for advanced rendering effects.
  • animations/: Configuration files that define animation frames, sprite sheets, and timings.
  • others/: Any other assets not covered by the above categories.

Asset Loading and Management

Assets are loaded at runtime by the graphical module through the IDisplayModule interface:
  1. Sprites (PNG):
    • Loaded using the storeAssetsPNG function, which reads the sprite file and prepares it for rendering.
  2. Sound Effects (WAV):
    • Managed with the storeAssetsWAV function to load and play sounds.
  3. Fonts (TTF):
    • Loaded using the storeAssetsTTF function for text rendering.
  4. Animations:
    • Configured with configAssetsAnimations to map sprite sheets and frame data.

Best Practices for Asset Management

  1. Organize Assets: Keep assets logically structured within subfolders to improve maintainability.
  2. Optimize File Sizes: Use compressed images (PNG) and sound files (WAV) to reduce loading times.
  3. Avoid Redundancy: Remove unused assets to minimize project size.
  4. Consistent Naming: Use a clear and consistent naming convention for assets, such as:
  5. Centralize Configuration: Store animation configurations in dedicated files to simplify updates.

Conclusion

The assets/ folder is the centralized location for managing all game-related assets. With clear organization and runtime loading through the IDisplayModule interface, the R-Type project ensures an efficient and scalable approach to asset management.