[r173] physics javascript failure

  • Problem Description

    One physics object, no other objects, layout does not run and shows javascript error. This is reduced from a project I am working on. The object in this capx was the one I last added to my game and caused it to then crash on run - the error happens with both box2d and asm.js although asm.js was selected when the object was added.

    Attach a Capx


    Description of Capx

    Project has one object only and a family that gives the object the physics behavior. Run the layout.

    Steps to Reproduce Bug

    • Run the layout Observed Result In browser: and in Node Webkit: {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang2057{\fonttbl{\f0\fnil\fcharset0 Calibri;}} {\colortbl ;\red0\green0\blue255;} {\*\generator Riched20 6.3.9600}\viewkind4\uc1 \pard\sa200\sl276\slmult1\f0\fs22\lang9 Assertion failed: 3 <= count && count <= 8, at: Box2D_v2.2.1/Box2D/Collision/Shapes/b2PolygonShape.cpp,122,void b2PolygonShape::Set(const b2Vec2 *, int32) at Error\par at Error (native)\par at x.___assert_func ({{\field{\*\fldinst{HYPERLINK

      localhost/Physics_behavior.js:233:28 }}{\fldrslt{http://localhost:50000/Physics_behavior.js:233:28\ul0\cf0}}}}\f0\fs22 )\par

    at dc ({{\field{\*\fldinst{HYPERLINK localhost/Physics_behavior.js:213:73440 }}{\fldrslt{http://localhost:50000/Physics_behavior.js:213:73440\ul0\cf0}}}}\f0\fs22 )\par

    at nQ ({{\field{\*\fldinst{HYPERLINK localhost/Physics_behavior.js:214:142833 }}{\fldrslt{http://localhost:50000/Physics_behavior.js:214:142833\ul0\cf0}}}}\f0\fs22 )\par

    at Q.Set ({{\field{\*\fldinst{HYPERLINK localhost/Physics_behavior.js:482:367 }}{\fldrslt{http://localhost:50000/Physics_behavior.js:482:367\ul0\cf0}}}}\f0\fs22 )\par

    at createPolygonShape ({{\field{\*\fldinst{HYPERLINK localhost/Physics_behavior.js:568:11 }}{\fldrslt{http://localhost:50000/Physics_behavior.js:568:11\ul0\cf0}}}}\f0\fs22 )\par

    at behinstProto.createBody ({{\field{\*\fldinst{HYPERLINK localhost/Physics_behavior.js:1469:24 }}{\fldrslt{http://localhost:50000/Physics_behavior.js:1469:24\ul0\cf0}}}}\f0\fs22 )\par

    at behinstProto.postCreate ({{\field{\*\fldinst{HYPERLINK localhost/Physics_behavior.js:1083:8 }}{\fldrslt{http://localhost:50000/Physics_behavior.js:1083:8\ul0\cf0}}}}\f0\fs22 )\par

    at Runtime.createInstanceFromInit ({{\field{\*\fldinst{HYPERLINK localhost/preview.js:2803:28 }}{\fldrslt{http://localhost:50000/preview.js:2803:28\ul0\cf0}}}}\f0\fs22 )\par

    at Layer.createInitialInstances ({{\field{\*\fldinst{HYPERLINK localhost/layout.js:1316:25 }}{\fldrslt{http://localhost:50000/layout.js:1316:25\ul0\cf0}}}}\f0\fs22 )\par


    Expected Result

    No error on run.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    W8.1 x64

    Construct 2 Version ID


    Edited to change the title to what it should have been!

  • This is simply because the asm.js version of box2d currently only supports collision polygons with a maximum of 8 points. I'm afraid you have to either use fewer points in your poly or switch back to box2dweb mode. Closing as won't fix.

  • OK Ashley, thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley, I couldn't find that info in the manual - might be worth adding if my searching isn't at fault, thanks.

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