This project demonstrates how to use broadcasts and sensing to pick up objects like keys to open doors in your maze. There is code on the cat, the key, and the door that is necessary to make this work, so be sure you look at all of those pieces of code.
Credit to AISweigart for the starter project.