mitchwadair / sidescroller-framework

A framework for CraftStudio (https://sparklinlabs.itch.io/craftstudio) to make creating 2D games simpler and easier
https://www.sframework.net
MIT License
0 stars 0 forks source link

Add an SFramework Physics Function to Enable Debug #12

Open mitchwadair opened 3 years ago

mitchwadair commented 3 years ago

Add a new function to physics to enable a debug setting. This setting (as of right now) would just add a collider visualizer to the game objects with some opacity level. Example:

SF.physics.enableDebug() -- would set SF.physics.debug to true

Then any Physics object's awake function will add the visualizer if enabled, or if called during runtime (which I think would be discouraged) go through the physics object tree and add them to existing ones. Visualizer size would be determined by the Physics object's size settings.

As an aside, I think making the visualizers solid for this change would be beneficial, as they look a little bit odd when stretched