Jump to content

Search the Community

Showing results for tags 'setcircle'.

  • 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
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • 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 2 results

  1. I have a staticGroup of floating coins from a tilemap and I wanted to make the collision area circular and the correct size however: I tried calling `setCircle` on each object in the group but it has no effect. If I change the staticGroup to a group, I can see the circle form when using debug mode. However this then subjects the group to gravity and my objects fall out of the game Here's the relevant code: function create() { var coinTiles = map.addTilesetImage('coin'); coinLayer = map.createDynamicLayer('Coins', coinTiles, 0, 0); // I tried changing this to this.physics.add.group(); coinGroup = this.physics.add.staticGroup(); // Loop over each Tile and replace sprite coinLayer.forEachTile(tile => { if (tile.index === 17) { const x = tile.getCenterX(); const y = tile.getCenterY(); const coin = coinGroup.create(x, y, "coin"); // This line seems to have no effect on static objects. coin.body.setCircle(10, 10 , 10); coinLayer.removeTileAt(tile.x, tile.y); } }); // etc... } staticGroup: Group: (ignore circle offset being completely off)
  2. Hi guys, new to Phaser so maybe this isn't a bug. I searched on the forum but i cannot find any information about it, hope it will be not already asked. I found an issue regarding the circle body collider, in particular when scaling a sprite the circle collider doesn't fit the new scale of the sprite. You can try this out by modify the "Circle vs Polygon" example, just add this line of code: "sprite4.scale.setTo(0.7, 0.7);" after creating sprite4 in create() function. You can find an image attached. The fact is that if you remove the circle body (using the rect one) everything's fine. I think that is possible to modify the center of the collider manually, but i wanted to signal the problem.
×
×
  • Create New...