When an officer has reasonable suspicion that a civilian poses a threat to his life, he can shoot them. Once police start shooting they are trained to continue shooting until the target is incapacitated. That's the law. Whether the recent shootings you saw meet that standard is up for debate.