WASHINGTON — In Marvel’s latest popcorn thriller, Captain America battles Hydra, a malevolent organization that has infiltrated the highest levels of the United States government. There are missile attacks, screeching car chases, enormous explosions, evil assassins, data-mining supercomputers and giant killer drones ready to obliterate millions of people.

Its inspiration?

President Obama, the optimistic candidate of hope and change.

Five and a half years into his presidency, Mr. Obama has had a powerful impact on the nation’s popular culture. But what many screenwriters, novelists and visual artists have seized on is not an inspirational story of the first black president. Instead they have found more compelling story lines in the bleaker, morally fraught parts of Mr. Obama’s legacy.

“We were trying to find a bridge to the same sort of questions that Barack Obama has to address,” said Joe Russo, who with his brother, Anthony, directed “Captain America: The Winter Soldier.” “If you’re saying with a drone strike, we can eradicate an enemy of the state, what if you say with 100 drone strikes, we can eradicate 100? With 1,000, we can eradicate 1,000? At what point do you stop?”