Box2D+ (Behaviours)

0 favourites
  • Box2D+ — No longer for sale in the Scirra Store!

    New Buyers - get it at itch.io

    Introduction

    This plugin offers nearly full access to the r2.3.0 Emscripten JavaScript port of Box2D and also contains many functions to make the game creation process easier (for example, you can get a collision shape from image alpha). Take a look at the feature list below - if you want even more detail then try out the demos and have a read through the instructions.</p><h3>Feature List</h3><div class="deshr"></div>

    • Create collision polygon from image alpha.
    • Circle, polygon and box shapes.
    • Speed clamp / rotational speed clamp.
    • Get exact collision point.
    • Dynamic, Static and Kinematic bodies.
    • Collision filtering (category bits & mask bits, also collision group index and collision-disable from Pre-Solve condition).
    • Individual object gravity scale.
    • Set world x and y gravity.
    • Load the collision hull from a c2 json array. Change the collision shape in-game by loading an array.AsJSON of x and y vertices into the object.
    • Export collision hull shape as a c2 json array.
    • Raycast world queries. Get raycast object list with collision point, normal and object UID.
    • Set object properties 'globally' by using object UID. For example, find an object using Raycast and change its properties without having to pick it as you would normally using events.
    • All joints are demo'd here:

      box2dplusdemo2.bitballoon.com/[/li][li]Assimilate Joint - demo: box2dassimilatedemo01.bitballoon.com . A totally stable alternative to a weld joint. Join together dozens of objects with no joint fighting!

    AABB world queries (quickly find objects within an area)Gravity attractor.Compatible with Google closure compiler (Construct 2 Minify export).Demo: box2dplusdemo1.bitballoon.com/[/li][/ul]%3Ch3%3ENote:%3C/h3%3E%3Cdiv class="deshr"></div>
      This behavior is not compatible with the standard Physics plugin.Box2D+ will create a box shape if the created collision shape results in very short vertices. The minimum supported vertex length is 2.5 pixels.

      Use this topic to leave comments, ask questions and talk about Box2D+

    • Try Construct 3

      Develop games in your browser. Powerful, performant & highly capable.

      Try Now Construct 3 users don't see these ads
    • v1.18 has been submitted to the store for approval.

      Updates:

      Bugfixes:

      • The collision filter values could be incorrectly limited when using events to change the collision mask or collision category.

      Additional features:

      • Expression added to obtain the time taken for the Box2D+ world to step (in milliseconds) - for debugging or stress monitoring when not using debug preview.
      • Debug Preview is now supported! All relevant values can be observed and/or edited in the Debug Preview pane. The world step time is displayed as "physics simulation" in the "Profile" tab.

      Edit - now v1.18 - There was a type-o in the edittime.js that I just couldn't ignore...!

    • v1.19 is up for approval.

      Added: Set circle shape radius. The radius can be anything you want - it doesn't have to be tied to the object's size.

    • Forthcoming update submitted for approval:

      v 2.00

      Some fundamental changes to the trigger conditions.

      Deprecated conditions

      (still present in edittime.js but they no longer do anything and did not add value to the plugin - use Box2D+ On Collision instead)

      Begin Contact

      Begin Contact With Obj

      Post Solve

      Post Solve With Obj

      End Contact

      End Contact With Obj

      New Conditions

      On Collision

      On Collision With Obj

      (On collision essentially replaces the End Contact)

      Is in contact

      Is in contact with obj

      (Is in contact returns true when touching / remaining in collision with another object)

      SOL support has been adjusted.

      Actions modified

      Revolute joint recreation now gives accurate location.

      Bug fixing

      Various minor bugs that were caused by layout restarts or changes when objects had been disabled or joints removed. Also fixed a bug where joints would not always be removed correctly on action.

    • v2.01 submitted for approval

      Minor bug fix. Occasionally, after On Create, an image-alpha scan or AsJSON polygon input would not change the c2runtime collision shape (it always worked in Box2D+). Just tidying up.

    • Hi Colludium,

      Just bought this and got a problem - Unzipped and placed it in ....\Construct 2\exporters\html5\behaviors when I start Construct 2 it says it cannot load your behavior as it cannot find ....\Construct 2\exporters\html5\behaviors\Box2D+\common.js .

      Any ideas?

      Cheers,

      RR

    • Hi Colludium,

      Just bought this and got a problem - Unzipped and placed it in ....\Construct 2\exporters\html5\behaviors when I start Construct 2 it says it cannot load your behavior as it cannot find ....\Construct 2\exporters\html5\behaviors\Box2D+\common.js .

      Any ideas?

      Cheers,

      RR

      Hi. Can you PM me a Dropbox link to the zip file you downloaded. I'll take a look. It could be that the file was corrupted because this is unusual. Thanks.

    • I got it from here: [link removed by MOD at request of Colludium] - oops, just thought probably not a good idea to post my download link here.

      One drive link for the file I downloaded - [link removed by MOD at request of Colludium]

      It has no .js files in the archive. I have downloaded the file more than once.

    • RattyRat, please use PM not public post

    • RattyRat, all of the files are present. Please try this instead: use 7zip to rename the .c2addon to .zip. Then open the archive and copy Box2d+ from the folder 'files' and place it in your c2 behaviours folder (...program files/construct 2/exporters/html5/behaviours). It should then work.

    • RattyRat

      Please be careful when you publish links. The links linked to commercial software.

      I have had to edit your post to remove the links.

      Thanks

    • Hi Colludium - Could you post the capx of your Assimilate joint demo, I am trying to use it but am getting some odd results.

      I need to grow my player object (essentially add more sprites) and fix them together using Assimilate but as soon as I get to the third object the first one`s shape seems to get lost (stops colliding) although it is still attached to the other sprites.

    • RattyRat - of course: link to assimilate demo capx.

    • Cheers

    Jump to:
    Active Users
    There are 1 visitors browsing this topic (0 users and 1 guests)