From a2e7fff352a39fddc6c4340924006a6310fdb339 Mon Sep 17 00:00:00 2001 From: DNin01 <106490990+DNin01@users.noreply.github.com> Date: Sun, 4 Jun 2023 17:35:57 -0700 Subject: [PATCH 1/2] Add documentation for Box2D extension --- extensions/box2d.js | 1 + website/box2d.html | 206 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 207 insertions(+) create mode 100644 website/box2d.html diff --git a/extensions/box2d.js b/extensions/box2d.js index eac937043d..fb53f329d5 100644 --- a/extensions/box2d.js +++ b/extensions/box2d.js @@ -12354,6 +12354,7 @@ default: "Physics", description: "Label for the Griffpatch extension category", }), + docsURI: "https://extensions.turbowarp.org/box2d.html", menuIconURI: menuIconURI, blockIconURI: blockIconURI, blocks: [ diff --git a/website/box2d.html b/website/box2d.html new file mode 100644 index 0000000000..90fb6e1c99 --- /dev/null +++ b/website/box2d.html @@ -0,0 +1,206 @@ + + +
+ + +Adjust the physics of all sprites.
+ + +Choose a type of containment to keep sprites within the stage.
+Change the direction and strength of gravity.
+ +Move forward in time by one step. Run this in a loop to keep the physics going.
+ +Manipulate individual sprites.
+ + +Make physics apply to this sprite. It can also collide with other sprites that have physics enabled.
+ +Precision mode will make the sprite work extra hard to make sure it doesn't overlap with anything. Note that this can decrease performance and even cause the project to get stuck, so use with care.
+ +Make the sprite go to the specified location.
+ +Set the velocity (speed) of the sprite to the specified value.
+ +You can get the velocity of the current sprite with the (x velocity) and (y velocity) reporters.
+ +Directly send the sprite flying in a certain direction, adding on to its current velocity.
+ +Set the angular velocity (rotational speed) of the sprite to the specified value.
+ +You can get the angular velocity of the current sprite with the (angular velocity) reporter.
+ +Directly send the sprite spinning, adding on to its current angular (rotational) velocity.
+ +Choose whether the sprite is fixed in place or can move around.
+ +You can tell if the sprite is currently fixed in place with the (fixed?) reporter.
+ +Set the sprite's density, which affects how heavy it is.
+ +You can get the sprite's current density with the (density) reporter.
+ +Set the sprite's roughness. Smoother settings make the sprite slipperier.
+ +You can get the sprite's current friction with the (friction) reporter.
+ +Set the sprite's bounciness.
+ +You can get the sprite's current bounciness with the (bounce) reporter.
+ +Returns what other sprites the sprite is touching. Also includes the edges of the stage.
+ +If there are multiple sprites touching, it will return a comma-separated list of them.
+ +Move the camera around the world.
+ + +Scroll to the desired location.
+ +You can get the current screen position with the (x scroll) and (y scroll) reporters.
+ +This will not affect the world boundaries set by the [setup stage] block.
+ +The block SVGs were generated with scratchblocks.
+