I want to set the size of an collider of a whole group. Every Object should be smaller as it seems on the screen.
So i know i have to use : MyObject.setSize(width,height)
but i can’t implement it into my code like i need to.
1.)this works---->
this.bananaGroup = this.physics.add.group();
this.bananaGroup.create(400, 0, 'banana').setScale(0.5).setSize(20, 20);
2.)but i need also this Calculation there:
var bananaGroup = this.physics.add.group({
key: 'banana',
--> repeat: 1,
--> setXY: { x: (Phaser.Math.Between(150, 800)), y: 0, stepX: 70 }
});
Two questions: How can i put a Function Call like .SetSize into the second example?
How can i put the math into the first example?
How could i change the Shape of the object and not only the size?