Jump to content

Search the Community

Showing results for tags 'Box2d tiled object layer'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hey all, Iam using the Box2d plugin in combination with tiled. I have a seperate object layer that i want to use to create body/collisions, i noticed that box2d plugin does not have the convertCollisionObjects function so i tried to put it in myself: convertCollisionObjects: function (map, layer, addToWorld) { if (addToWorld === undefined) { addToWorld = true; } var output = []; for (var i = 0, len = map.collision[layer].length; i < len; i++) { var object = map.collision[layer][i]; var vertices = []; for (var i = 0, len = object.polyline.length; i < len; i++) { vertices.push(object.polyline[i][0]) vertices.push(object.polyline[i][1]) } console.log(vertices); var body = this.createPolygon(object.x, object.y, vertices); body.setPolygon(object.polyline) body.setPolygon(object.polyline) if (body) { output.push(body); } } return output; },vertices that is given as input: ([0, 0, 0, -32, 32, -32, 32, -64, 128, -64, 128, -32, 160, -32, 160, 0, 0, 0]) gives me the following error: does anyone know what im doing wrong? or are there any other ways to get tiled objects from tiled? cheers!
×
×
  • Create New...