It was Hamas itself who was killing civilians trying to flee the bombing by Israel. Israel told them which way to flee, and Hamas said, "No, you don't!"
Documenting your point:
“The Israel Defense Forces releases an audio recording of an officer in the Military Intelligence Directorate’s Unit 504 — which specializes in HUMINT — speaking to a Gazan man, during which he describes how Hamas is preventing people from evacuating from the northern part of the Gaza Strip and even shooting at them.”