I asked about this scenario of our CH class instructor who is an active officer. He advised to secure your children first. Choose a place to stand your ground with your family behind you. Stand in front of their door and wait for bad guy to come to you. This way, you know your bullets will not stray. Just as learning fire safety, they can learn what to do whenever the code word is enacted if practiced enough.
He also suggested to keep a flashlight in your gun safe.