Can Custom Collision Shapes be done on a Txt File?

I really, really need custom collision, but the things is, I really only need a smaller box size, a rectangle will do.

Can I just use a simple txt file or code sniped and import that?
If so, how?? Are there any examples around?

Cheers!!!

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Not that I know but why not use the Physics Body Editor -- it's free and super easy to use when it's installed.

  • dimsdaledimsdale Member Posts: 499

    can't work out how to install it ;(

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069
    edited December 2015

    You could generate some json manually that would work, but why not just use PBE? Gui is nice to have for setup.

    If you wanted to go the all txt route. The structure would be something similar to:

    {
    "rigidBodies": [
    {
    "normalized":false,
    "rescale":false,
    "origin":{"x":0,"y":0},
    "size":{"width":0000,"height":0000},
    "polygons": [
    [
    {"x": 0, "y": 0 },
    {"x": 0, "y": 0 },
    {"x": 0, "y": 0 },
    {"x": 0, "y": 0 }
    ],
    ]

    }
    ]
    

    }

    The width and height and the four points (vertices) would need values added. More points could be added following the same structure. Save it as insertname.json

    Edit: Btw the width and height refers to the actors size you intend to put this in. It should be full retina values if you are working in a retina project instead of half.

    Follow us: Twitter - Website

  • tmanntmann Member Posts: 278

    @dimsdale get the version of Physics Body Editor from here (half way down the page, red link, "here is a version" ) it is wrapped with the Java 6 runtime so will work regardless of how fubar or not your own Java installation may be.

  • mhedgesmhedges Raised on VCS Member Posts: 634

    @dimsdale ,

    Physics Editor isn't that bad, and it's only $20 including future upgrades. If there's a nitpick I have with it, it's that I have to select GameSalad every time I want to publish the json file. If you decide to continue using GS, it's worth considering IMHO.

Sign In or Register to comment.