maikthomas

Members
  • Content Count

    5
  • Joined

  • Last visited

About maikthomas

  • Rank
    Newbie

Profile Information

  • Gender
    Male
  • Location
    Madrid
  • Interests
    Phaser 3

Contact Methods

  • Twitter
    mikethomas_tech
  1. Thanks @samme, I tried that but no luck. I've opened an issue with Phaser on github https://github.com/photonstorm/phaser/issues/4168 I might take a look at the code myself if I get some time. Edit: I have opened a PR with the fix https://github.com/photonstorm/phaser/pull/4170
  2. Ok, so now I'm starting to think it is working, and it's actually the debug render that is wrong. Refresh still not needed though. Images below show what I believe to be a bug. !! NOTE: The white circle is the sprites helmet, it is not a debug shape or anything to do with the coin. I now realise how confusing this picture might be. left: setCircle() - we can see the debug squares overlapping and yet the coin (yellow) is still there right: setSize() - squares are barely touching and coin has already been collected.
  3. Hi samme, thanks for your reply! Unfortunately that's not solved it for me. I tried coinGroup.refresh() and I also tried calling refreshBody() on each Individual object. The bodies are still square (see below). I'm not sure refresh is the issue as setCircle does have a effect, it is just not the desired effect: Before setCircle: after setCircle (and after any combination of refresh functions)
  4. 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)
  5. I seem to have the same issue. I can see the properties in the json but they are not read by phaser.