It is rarely a good sign to find yourself yowling with laughter while watching a film that’s supposed to lull you into solemn contemplation. There are a few such moments in Live by Night, Ben Affleck’s love letter to – and hopefully death knell of – the classic Hollywood gangster flick. I recommend smuggling some bingo cards into the cinema (and some illicit rum cocktails) so you can at least make a game of its cliches.

There are speakeasies aplenty, all of them jumping. There are double-crossing molls. There are corrupt Irish policemen, Italian-American hoodlums with Tommy guns, and showdowns in the shadowy corridors of fancy hotels. I’m pretty sure someone calls someone else a “knucklehead” at one point. And there is no shot of Ben Affleck (yes, he stars as well as produces and directs) that does not underline just how much Joe Coughlin, the gangster hero he portrays, is on the right side of American history. We are never left in any doubt that his mobster is someone to whom we should all aspire. “You realise that to be free in this life,” runs his voiceover, “breaking the rules means nothing. You have to be strong enough to make your own.” Full house!

Live by Night is an adaptation of Boston author Dennis Lehane’s novel (Affleck also adapted his Gone Baby Gone). While not exactly a disaster, it’s something of a cautionary tale. After winning the best picture Oscar for Argo four years ago, Affleck had the rare opportunity to make whatever movie he wanted: “It was sort of pick what you want to do and this is what I wanted to do,” he said. “I wanted to make a classic Warners picture.”

Robert Richardson, Quentin Tarantino’s long-time cinematographer, ensures it all looks beautiful – you’ll want to book a night out in Prohibition-era Florida immediately – and there are compelling turns from Elle Fanning as a fallen starlet turned one-woman-religious-right and Sienna Miller as an Irish super-vixen. The violence is so stylishly choreographed it looks like an Armani ad, and the baddies – including the local chapter of the Ku Klux Klan – always get what’s coming to them.

Still, Affleck clearly hopes to provide not mere entertainment, but a critique of US capitalism – and in so doing illuminates the essential hypocrisy of the gangster genre. He wants to be the bad guy and the good guy at the same time. Lehane’s Live by Night novels (there are three) might have worked better stretched over a TV mini-series, but it’s not as if HBO’s Boardwalk Empire breathed much fresh life into a genre exhausted by The Sopranos. Ridley Scott’s heavy-handed American Gangster and Ruben Fleischer’s limp Gangster Squad have also fallen short in recent years. The gangster now stands way below the superhero in modern movie myth-making. Don’t be surprised if Affleck’s paymasters hold him to a couple of extra Batman movies by way of penance.

Facebook Twitter Pinterest Pinnacle … Al Pacino in Scarface, 1983. Photograph: Allstar/Universal

It’s a surprising turn of events since, in recent memory, the gangster movie was pretty much the pinnacle. The two most revered modern male leads – Al Pacino and Robert de Niro – made their names with mumbling mobsters. So too did the two most admired directors, Francis Ford Coppola and Martin Scorsese. If you’ve ever bought an eighth of weed from an English public schoolboy, you’ll appreciate the deep penetration these movies made on the popular psyche. A certain kind of teenager always wished to be Pacino in Brian De Palma’s Scarface. “Gangster” is a term of playground respect, a fantasy of being unconstrained by law or conscience. You might see the whole genre as a form of capitalist pornography.

The opening of Scorsese’s Goodfellas lays out the wish-fulfilment aspect pretty clearly. “As far back as I can remember, I always wanted to be a gangster,” says Ray Liotta, the wistful Wonder Years tone jarring with the horrific violence that his character, the young Henry Hill, witnesses from his window. Scorsese never denies the allure of crime, with its dizzying highs, terrifying lows, and creamy middles. But the joke of the title is that the good fellas are really exceptionally evil fellas.

Facebook Twitter Pinterest Horrific violence … Goodfellas, 1990, with Joe Pesci, Robert De Niro and Ray Liotta. Photograph: Ronald Grant

The movie culminates in the famous diner scene where De Niro makes it clear to Liotta that he will have to kill him (though gangster dialogue is never that clear). Scorsese’s reverse-tracking shot, zooming inwards while moving the camera outwards, makes the scene pulsate with the dawning realisation. Still, it’s so subtle, you might miss it. What stains the memory are those lovable mobsters, those balletic hold-ups.

It was the original 1932 Scarface that laid out the speciousness of the genre. Set in gangland Chicago, Howard Hughes and Howard Hawks’ gleeful opera of violence was released one year after Al Capone was put away for tax evasion. It took two years of wrangling with the American board of censors before audiences were allowed to see it. The subtitle “Shame of a Nation” was tacked on, along with a final judgment scene and a bit of pre-title moralising that allowed its creators to have their cake and shoot it to bits: “This picture is an indictment of gang rule in America and of the callous indifference of the government to this constantly increasing menace to our safety and our liberty. Every incident in this picture is the reproduction of an actual occurrence, and the purpose of this picture is to demand of the government: ‘What are you going to do about it?’ The government is your government. What are YOU going to do about it?”

Facebook Twitter Pinterest Shame of a nation … 1932’s Scarface, with C Henry Gordon, Paul Muni and George Raft. Photograph: Allstar/United Artists

The 19th amendment, prohibiting alcohol, allied the average drinking moviegoer with the mobsters against the police

From the outset, then, an uneasy dynamic was established. It was fine to envy the freewheeling mobsters because, ultimately, you would have the satisfaction of seeing them brought to judgment. And you were perfectly at liberty to enjoy all the bloodletting as long as you remembered who the real villains were. No, not the mobsters – but the government and its agents. And in the 19th amendment, which prohibited alcohol from 1920 to 1933, the moviegoing public had an obviously dim bit of legislation to rail against: a ruling that put the average whiskey-drinker in loose alliance with the mobsters against the police.

“I violate the Prohibition law, sure, who doesn’t?” Al Capone once reasoned. “The only difference is I take more chances than the man who drinks a cocktail before dinner and a flock of highballs after it.” Indeed, the moral pushed hardest in the gangster genre is that you mustn’t be a rat and spoil everyone’s fun. As Gore Vidal once noted: “In a sanctimonious society of hustlers, which is what the United States has been from the very beginning, the first law is, ‘I won’t blow your scam and you don’t blow mine.’”

Live by Night makes similar efforts to expose the iniquities of American capitalism. “Witness the price of the American dream,” says the trailer. But Affleck is determined to paint his outlaw not merely as a hustler, doing what he can to survive, but as a figure worthy of sympathy and admiration. The opening sequence takes place in the trenches of northern France, where Coughlin serves as a US conscript. When he returns to his native Boston, he is so disillusioned with his homeland, he somehow feels his only option is to rob banks.

“I went away a soldier, I came home an outlaw,” he says. But while your Corleones and Sopranos were in the family business, locked into a rigid, semi-aristocratic hierarchy, Coughlin is essentially freelance – an uberhoodlum, if you will, beholden to no one. Somehow his chief-of-police father – played by Irishman Brendan Gleeson – is willing to turn a blind eye when by rights he should have locked him up.

Facebook Twitter Pinterest Only required to look foxy and concerned … Zoe Saldana in Live by Night. Photograph: Allstar/Warner Bros

Later, the action moves to Florida, where Coughlin must repay a debt to an Italian mobster named Pescatore. It seems there have been a few problems with Pescatore’s supply of rum from Cuba, giving Affleck a chance to prove his liberal business ethics. The usual way for the gangster hero to get ahead is to show greater guile, cunning or bloodlust than his rivals. Violence is a constant – what matters is how judiciously you use it. Here, however, Coughlin shows greater compassion. His innovation is to treat a dark-skinned Cuban rum manufacturer with respect, cutting his family in on the deal and thus dispensing with costly middle-men (Denzel Washington pulls off a similar trick in American Gangster).

You can imagine how this multicultural entrepreneurship goes down with the local white supremacists. Coughlin then inflames them further by marrying the man’s sister, played by Zoe Saldana, who has very little to do except look foxy and concerned. At one moment, she worries that his various double-crossings will come back to haunt them. “You don’t think I’m strong enough?” he asks. “I don’t know if you’re cruel enough,” she responds. Beat. “Powerful men don’t have to be cruel.” Yes, they can be social justice warriors, too!

All of which would be lovely, had Coughlin not spent the entire movie being cruel. And if the denouement didn’t involve further lashings of cruelty. And if Affleck had allowed any non-white character to do anything except admire him.

A more interesting place to play out these themes would be the inner cities of America in the 80s and 90s, where crack cocaine offered Prohibition-style business opportunities for young African-Americans and allowed “gangster” to take on its present playground meaning. The dynamics of the “dope game” (Jay Z, passim), and the ways in which it both undermines and exemplifies the American dream form the basic content of gangster rap.

However, you rarely see this played out on the big screen. It is cheap to make hip-hop records, and expensive to make Hollywood films, after all. Affleck is one of a handful of (white) stars with the clout to make things happen – but such a storyline would deny him the opportunity to cast himself as the hero. At best, he might get to play a socially conscious cop. No fun at all.

Then again, perhaps the notion that a lack of conscience and an excess of vanity really do pay is simply too close to the bone in America in 2017. The system is rigged, folks. As the young Michael Corleone says of his old man in the Godfather: “My father’s no different than any other powerful man, any man who’s responsible for other people – like a senator or a president.”