Micro:bit sensor for "scoring goals"? (sensing when 'ball' goes over line)

I need to purchase some sensors that can be used in a pretend goal - sensing whether or not a ball or ball like object has passed over a “line”.

Can anyone recommend such a part please?
Ideally I would have one of these devices connected to a micro:bit that could then display a score on the micro:bit, whenever a ball passed over a line (wire/ sensor?) into the net

Something like this maybe, https://shop.pimoroni.com/products/ir-break-beam-sensor-5mm-leds

Hi, I do an electronic games project using Microbit with my Year 7 classes, we make goals using a net designed on 2D CAD and cut out of HIPS, they strip heat it and bend to form a goal, the sensor is made using a flap that hinges at the top, it has a strip of sticky back copper strip on the back of the flap and 2 connections on the back wall of the goal. I use recycled roll on deodorant balls coloured with a sharpie! they pick up a goal quite effectively! I connect wires to the microbit with my custom method!! get a strip of choc blocks, strip off plastic, remove screws, hacksaw 2 cuts into one side to remove a slot slightly wider than the thickness of the board. Slide over the input pin and screw the grub screw back down to make a connection- wire in the other end, job done. The kids do all this themselves, it’s a bit fiddly but works quite well. The goals idea came from here: https://make.techwillsaveus.com/microbit/activities/microfootball

hope this helps!