[Behavior] Box2D+ (asm.js r2.3.0; v2.0)

Post your completed addons to share with the community

Post » Wed Jan 17, 2018 7:00 am

Colludium wrote:@gameba - thanks for the bug report! I'll take a look and get back to you as soon as I can.

Edit - I have a fix, I should have it all ready later today.


OK thank you
B
44
S
25
G
25
Posts: 85
Reputation: 16,424

Post » Wed Jan 17, 2018 8:31 pm

v 1.20 now uploaded to the store for approval.

Bugfix - some of the Collision with Object Type triggers were not firing.
A big fan of JavaScript. Image Image Image
B
76
S
20
G
87
Posts: 2,359
Reputation: 53,212

Post » Sat Jan 20, 2018 5:52 pm

Work in progress - warning of a minor breaking change in the next update!

Hi,

I am re-working the collision triggers for Box2D+ to fix a bug and to make it impossible to accidentally use the events in ways that are incompatible with the Box2D+ library. I have looked at what information is available, how reliably the plugin can create the information and what can be done with that information. From that, I am going to deprecate the following triggers:

Begin Contact
Begin Contact With
Post Solve
Post Solve With
End Contact
End Contact With

And I am going to move the collision trigger to the standard c2 collision triggers

On Collision
On Collision With

This means that all actions will be available after the collision trigger and the only other collision information that will be available, the Pre-Solve, can be used to cancel a collision as before. In the current plugin, it is impossible to, for example, set velocity to an object in an action after a collision trigger (the End-Contact trigger was 'adjusted' to enable this, but that has had a knock-on effect, because the End-Contact does not fire if the objects remain in contact at the end of the collision resolution).

I will also add other conditions:

Is In Contact
Is In Contact With

These will be true if the object is touching another object.

Aside from making it impossible to accidentally use the triggers in ways that are not supported by the rest of the plugin, this will improve performance of the behavior a little (some of the collision listeners will be deleted - the removal of each will reduce the number of function calls per collision). I will leave the conditions in the editor so that games do not crash, but they will no longer have any effect and will be marked as *Deprecated*.

I would be very grateful if you could let me know what you think of this - the changes might appear severe but I believe them to be necessary and I hope that they make sense / are acceptable...?

Please let me know your thoughts - any big disagreements and good arguments will be considered, of course! Thanks.
A big fan of JavaScript. Image Image Image
B
76
S
20
G
87
Posts: 2,359
Reputation: 53,212

Post » Sun Jan 21, 2018 6:34 pm

Forthcoming update:

v 2.00

Deprecated conditions (still present in edittime.js but they no longer do anything - replace with On Collision)
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)

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.
A big fan of JavaScript. Image Image Image
B
76
S
20
G
87
Posts: 2,359
Reputation: 53,212

Previous

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 9 guests