Hi,
I’m new to Phaser and trying to set myself some smallish starter projects. The first project I’m trying to create a simple 2D basketball game (from a side on view) but I’m struggling with the best way to setup the physics and colliders for some objects.
Specifically for the net, at present I have one sprite that includes the backboard and the hoop. I want the ball to be able to bounce off the backboard and the “rim” of the hoop at either side (left and right), but to be able to pass through the middle and trigger a score event.
Do I ultimately need to split the sprite into multiple pieces and manually place them together? (I tried using a container but that seems to suffer from issues when adding physics bodies to the children).
I also looked at adding multiple static images of “nothing” with physics bodies attached, again I would obviously need to position these manually with the hoop. After the player “scores” I want to move the position of the net to the other side of the screen and set a random height (and continue this every time they score) so I wanted to try and group as much pieces as possible so I’m not having the reposition multiple elements every time (hence trying to use a container).
Can someone advise on how I should approach this? For reference I’m trying to recreate something like this https://youtube.com/shorts/-HYLBuEPbus?si=yINRot-xPmReYh0P
Thanks