Basketball game using matter in Phaser3

I am going to create a basketball game on matter physics which is logically related to a pin ball.It has one flipper on the ground , which helps to shoot the ball whenever ball will fall on flipper.So i just want to logic behind this.