chadananda Posted August 8, 2018 Share Posted August 8, 2018 My very first project (Bayan Breakout - Bayan is my 5yr-old who did the artwork). I did what I thought was safe: grabbed a simple example (breakout) and changed out the images. The problem is that my bricks were quite a bit bigger than the ones I was replacing, so I simply added "SetScale" to fix. Looks great but the collisions are way off. What am I misunderstanding? CodePen: https://cdpn.io/RBeVzo Relevant section: this.bricks = this.physics.add.staticGroup({ key: 'assets', frame: [ 'brick-yellow.png', 'brick-blue.png', 'brick-green.png', 'brick-purple.png', 'brick-grey.png', 'brick-orange.png'], frameQuantity: 10, gridAlign: { width:10, height:6, cellWidth:64, cellHeight:42, x:0, y:50}, setScale: {x:.16, y:.16} // to size my bricks }) Link to comment Share on other sites More sharing options...
samme Posted August 8, 2018 Share Posted August 8, 2018 I thought StaticGroup#refresh() would take care of this but you actually need refreshBody(): https://codepen.io/samme/pen/jpQqQa?editors=0110 Link to comment Share on other sites More sharing options...
chadananda Posted August 8, 2018 Author Share Posted August 8, 2018 Thanks, that works great! Link to comment Share on other sites More sharing options...
Recommended Posts