Hello,
I am using matter physics in my phaser project.
I am creating a circle with add.circle :
this.circle = this.add.circle(100, 350, 50, 0xffffff); this.matter.add.gameObject(this.circle, { isStatic: true, shape: 'circle', render: { sprite: { yOffset: 0 } } });
Yes, it works as i coded.
But i want to add a triangle as this.
this.triangle = Phaser.Geom.Triangle.BuildEquilateral(400, 200, 200); this.matter.add.gameObject(this.triangle,{isStatic: true,render: { sprite: { yOffset: 0} }});
this.graphics = this.add.graphics({ lineStyle: { width: 2, color: 0xff0000 },fillStyle: { color: 0xaaaa00 } });
this.graphics.strokeTriangleShape(this.triangle);
this.graphics.fillTriangleShape(this.triangle);
Triangle shows in my canvas but matter physics doesnt effect on that.
I dont know why? Is there anyone to help to understand this.
Thanks.