A hooded sweatshirt spotted with blood lay on the ground along with sneakers and a black backpack. Dantee’s name, printed in neat handwriting, could be seen clearly on the cover of a notebook that poked out of the backpack. Nearby were medical supplies that had been used to treat the teenagers. Dantee lived in Crown Heights, Brooklyn, the police said. It was not immediately clear why he was at the Marcy Houses.

The police said an investigation was continuing.

Christian Collado, 27, a resident of the Marcy Houses, said he heard the gunshots from his apartment and watched as the police quickly arrived.

He said the area was normally quiet and that it was rare to see teenagers hanging out in the courtyard, but in recent days the housing project had grown tense.

“There have been a couple of shots in the past couple of days,” he said. “Four days ago, I heard two shots fired at around 2 a.m., then I heard cops come.”