State law varies widely. As many posters have already noted, it's pretty much open season in Texas on perps. In other states, you have a DUTY to try to flee your own home during a nighttime home invasion before resorting to pulling the trigger. It varies that widely.
Check it out. Get informed, or you may be going to prison for shooting a bad guy.
Excellent advice...