Skip to content

Organize physics usage examples into subfolders#705

Open
Nadiazahan wants to merge 2 commits intothoth-tech:mainfrom
Nadiazahan:organize-physics-examples
Open

Organize physics usage examples into subfolders#705
Nadiazahan wants to merge 2 commits intothoth-tech:mainfrom
Nadiazahan:organize-physics-examples

Conversation

@Nadiazahan
Copy link
Copy Markdown

Description

This pull request reorganises the physics usage examples into separate subfolders to improve structure and readability.

Previously, all physics example files were stored in a single directory. This made it harder to navigate and identify which files belonged to each example. This update groups each example into its own folder based on type.

The following subfolders were created:

  • sprite-bitmap-collision
  • sprite-collision
  • sprite-point-collision
  • sprite-rectangle-collision

Each subfolder now contains all related files for that example, including code files, images, text descriptions, and resource files.

The 0-README.md file has also been updated to reflect the new structure and guide contributors.


Type of change

  • Documentation (update or new)

How Has This Been Tested?

  • Verified that all files were correctly moved into their respective folders
  • Checked the folder structure in VS Code to ensure everything is organised properly
  • Confirmed no files were missing after restructuring

Folders and Files Added/Modified

Added:

  • public/usage-examples/physics/sprite-bitmap-collision/
  • public/usage-examples/physics/sprite-collision/
  • public/usage-examples/physics/sprite-point-collision/
  • public/usage-examples/physics/sprite-rectangle-collision/

Modified:

  • public/usage-examples/physics/0-README.md

Additional Notes

This change only restructures existing files and updates documentation. No functionality or example code was modified.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 25, 2026

Deploy Preview for splashkit failed.

Name Link
🔨 Latest commit a01f083
🔍 Latest deploy log https://app.netlify.com/projects/splashkit/deploys/69ce42c79093430008aac9f3

@anandika-nair
Copy link
Copy Markdown

Hi, I reviewed your PR and it looks well structured.

  • The reorganisation into separate folders makes the physics examples much easier to navigate
  • Grouping all related files together for each example is very helpful
  • The README update clearly explains the new structure and improves usability

I also checked the file movements and everything seems to be correctly organised without missing files.

I noticed the checks are failing, but this seems related to the build or deployment rather than the file reorganisation itself.

One small suggestion:

  • The folder names use hyphens while the file names use underscores, so keeping this consistent might make the structure even cleaner

Overall, this is a clear and useful improvement to the project. Good work!

Copy link
Copy Markdown

@rachelpatrao rachelpatrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I reviewed your PR and overall it is well structured and a clear improvement to the project.

The reorganisation of the physics usage examples into separate subfolders significantly improves readability and navigation. Grouping all related files (code, assets, and descriptions) within each example folder makes it much easier to understand and maintain. The update to the 0-README.md is also helpful and clearly explains the new structure.

I verified the file movements and everything appears to be correctly organised, with no missing files.

However, I noticed that the build checks are currently failing. This seems to be due to the existing scripts still expecting a flat directory structure. Since the files have now been moved into subfolders, the build process is unable to locate them, which is causing the error.

To fix this, the scripts (such as api-pages-script.cjs) will need to be updated to support nested folders when reading usage examples. Alternatively, the file paths being referenced in the scripts need to be adjusted to reflect the new structure. specifically look at the functions getAllFiles(), getUsageExampleContent(), getUsageExampleImports()

One additional suggestion is to maintain consistent naming conventions. Currently, folder names use hyphens while file names use underscores, so aligning these would improve clarity and consistency.

Next steps:

Update the build scripts to correctly read files from subfolders
Ensure file paths match the new directory structure
Standardise naming conventions (hyphens vs underscores)
Please run npm run build locally to confirm your changes

Overall, this is a valuable structural improvement, and with the build issue resolved, it will integrate well into the project. Good work!

@Nadiazahan
Copy link
Copy Markdown
Author

Thanks for the detailed feedback. I’ve updated the script to support nested usage-example folders and fixed the path handling so files in subdirectories are now read correctly. I also standardised the naming in the physics usage examples for consistency. I ran npm run build locally and the usage example scraping and API documentation generation completed successfully.

Copy link
Copy Markdown

@rachelpatrao rachelpatrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I reviewed your PR and overall it is well structured and a clear improvement to the project.

The reorganisation of the physics usage examples into separate subfolders significantly improves readability and navigation. Grouping all related files within each example folder makes it much easier to understand and maintain.
I verified the file movements and everything appears to be correctly organised, with no missing files.

The previous build issue related to file paths has now been resolved, and the project builds successfully with the updated folder structure. The current build failure appears to be due to unrelated link validation errors in other parts of the project, rather than this PR.
Approving this pr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants