Move the cat with WASD, rotate the proton beam with Q and E. Fire the proton beam with space. The beam only lasts for a few seconds and has to recharge for a while.
Press T to place the trap, and then T again to activate it. All ghosts need to be trapped in one shot.
Learn to program games with this free online Scratch course: https://inventwithscratch.com/class