Take a look at a map of Gaza: there's plenty of room outside of civilian areas to build bunkers and camouflaged places from which to fire rockets and mortars. Hamas places these assets in civilian areas betting that Israel will not attack for fear of the negative reaction to civilian deaths. The New York Times article explains that Hamas places civilians on the roofs of houses in which its fighters or weapons are to discourage the IAF from bombing them, and the IAF has taken to firing missiles rigged not to explode at the buildings to frighten the civilians away and then bombing the building.
The only real strength Hamas has in this battle is the negative reaction to civilian deaths, so Israel goes to great lengths to minimize civilian casualties in ways that are consistent with the success of the mission and the safety of its soldiers, while Hamas has organized its defenses in ways guaranteed to maximize civilian deaths.
Hamas has built hundreds of tunnel under the Egyptian border and hundreds more under the cities from which its fighters try to attack approaching Israeli troops, so why haven't they been able to build bomb shelters to protect Palestinian civilians? How many civilian casualties do you think Israel would have if it not built all those bomb shelters to protect its citizens?