A downloadable project

Buy Now£5.99 GBP or more

Emscripten Box2D for Construct 2 and 3

 v1.12

Introduction

If you've used Construct 2 or 3 then you'll be familiar with the standard Physcis plugin and how it offers limited access to r2.1.alpha of Box2D.  The Emscripten asm.js version of the standard plugin performs well on low-end devices, but it lacks many features that a game designer needs.  This plugin offers nearly full access to the r2.3.0 Emscripten JavaScript port of Box2D.  It is not just a direct access plugin, it also contains many functions to make the game creation process easier (like giving you the collision shape from the 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.

Feature List

  • Create collision polygon from image alpha (using hull.js and simplify.js).
  • 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 values into the object.
  • Exports collision hull as c2 json array.  This package includes a capx collision shape editor example so you can create polygons and set them in-game from the output string.
  • 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 then change its properties without having to pick it as you would normally have to using events.
  • All joints are demo'd here: link
  • Assimilate Joint - demo: link .  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).  You don't want people reverse-engineering your project.

Demo: link

What is included in the download:

  • Box2D+ plugin for Construct 2.
  • Box2D.c3addon for Construct 3.
  • Instructions: link.
  • Collision polygon editor capx.  Demo: link
  • Physics joints capx (commented - the one used to create the joints demo).
  • Collision disable example capx.
  • c3p files for Construct 3 for the above demos.

Questions

Please visit the Forum to discuss this plugin and view the devlog.

Note:
  • This behavior is not compatible with the standard Physics plugin.  
  • Box2D+ will create a box shape is the created collision shape results in very tightly packed vertices (eg 100px square with >45 vertices).  


More information

Published 26 days ago
StatusIn development
CategoryOther
Authorcolludium

Purchase

Buy Now£5.99 GBP or more

In order to download this project you must purchase it at or above the minimum price of £5.99 GBP. You will get access to the following files:

C2 & C3 behavior.zip 430 kB

Download demo

Download
Box2D+ Instructions.pdf 933 kB
Download
C2 demo projects.zip 456 kB
Download
C3 demo projects.zip 460 kB