When I change the scale of the container, the visuals and physics lines don’t fit, I still haven’t figured out how to fix it
import { Scene } from 'phaser';
export class Game extends Scene
{
constructor ()
{
super('Game');
}
create() {
this.cameras.main.backgroundColor.setTo(255, 255, 255);
const ballShape = this.cache.json.get('ball_shape');
this.sportItemsContainer = this.add.container(0, 0);
const basketball = this.add.image(350, 250, 'basketball');
this.matter.add.gameObject(basketball, { shape: ballShape.basketball });
basketball.setScale(0.6);
this.sportItemsContainer.add(basketball);
const football = this.add.image(450, 250, 'football');
this.matter.add.gameObject(football, { shape: ballShape.football });
football.setScale(0.6);
this.sportItemsContainer.add(football);
const tennis = this.add.image(400, 350, 'tennis');
this.matter.add.gameObject(tennis, { shape: ballShape.tennis });
tennis.setScale(0.6);
this.sportItemsContainer.add(tennis);
this.sportItemsContainer.setScale(1.5)
}
}