Chess was one of Samuel Beckett's great obsessions, touching everything from Murphy to Endgame. Perhaps this game of fierce purity and life-or-death stakes is the key to all his work

I am something of an interloper at the Samuel Beckett festival in Enniskillen, Northern Ireland. While the Beckettians are here to venerate the master and his works – concentrated, intense, elliptical – I have come for the chess, which is why on Sunday afternoon I find myself in the high street playing a game on a giant chess set against the man who created it, local sculptor Alan Milligan.

It is a monumental struggle, or would be if Milligan were any good at chess. Even though he designed the set, with bronze pieces modelled on Beckett's characters and pawns representing props used in his plays (boots and carrots from Waiting for Godot, a banana from Krapp's Last Tape, the pistol from Happy Days), he knows little about the game. In anticipation of playing me, he has been studying a book optimistically called Learn to Play Chess in a Weekend, but I still checkmate him in 20 moves. Don't give up, I tell him. Fail again. Fail better.

The set was supposed to be ready for last year's inaugural festival, but Milligan's studio burned down, so in 2012 he was able to present only the charred remains. "The pieces were black and blacker, which for Beckett seemed appropriate," he says wryly. Now the set has been recast, and is the centrepiece of this year's festival, which takes its cue from the playwright's fascination with chess.

Sean Doran, the festival's organiser, has planned the event like a chess game. A series of dance pieces inspired by Beckett's work form the graceful opening; short plays performed by Irish and Portuguese companies supply the crunchy, complex middle game; and the denouement (or in Beckett's case, anti-denouement) is provided by two productions of Endgame, from Australian company Wit's End and the Sligo-based Blue Raincoat Theatre.

Alan Milligan and Stephen Moss do battle on Milligan's Beckett chess set, built for the Beckett festival in Enniskillen. Photograph: David Fitzgerald

"I like the way in festivals you can go beyond what you ordinarily do," says Doran. "It's usually enough to have one Endgame in one town at one time, but to have two is something special. I wanted to play up the contrast: the productions are from different sides of the world, and play on Beckett's competitive spirit." Beckett went to the Portora Royal School in Enniskillen – the town's justification for gazumping his birthplace, Dublin, in staging this annual festival – as well as boxing and played cricket and rugby for the school.

Beckett had a lifelong interest in chess and was a keen player, following many of the big matches, says his nephew, Edward, who oversees the Beckett estate. Samuel was taught to play by his elder brother, Frank, and by his uncle, Howard, who achieved the remarkable feat of beating the Cuban José Raúl Capablanca, later world champion, at an exhibition in Dublin. There are a score of chess books in the library of Beckett's old flat in Paris, which is now occupied by Edward and his wife. Beckett played regularly with friends during the second world war, when he was holed up in France working for the Resistance; he liked to annotate master games – the chess books in his library are full of comments – and corresponded with Spanish playwright and fellow chess aficionado Fernando Arrabal. In the early 1940s, he also played – and lost to – Marcel Duchamp, an expert on the game who wrote a chess column for the Paris newspaper Ce Soir.

Poet John Montague, a close friend of his fellow Irishman in Paris in the 1950s and 60s, tells me that Beckett, who was ill at ease with people he didn't know well, would sit in a cafe moving the objects on the table around, "playing a fantasy game of chess", as Montague puts it. It is also tempting to see Beckett treating the stage like a chessboard. An exhibition in Enniskillen includes a diagram of his stage directions, in which he has drawn the precise angles at which actors should process across the space, as if the characters were pieces interacting in a chess game, and where any mis-move would spell disaster.

Endgame in particular is, as the title makes clear, infused with chess. "Me – to play," announces Hamm, the king on a battered throne, at the outset. In chess, the king is the key piece around which the game revolves, yet also the most restricted and impotent, able to move only a square at a time, just like Hamm, who is shuffled round the stage by Clov, the pawn who glimpses freedom. In chess, the feeble pawn, if it can progress to the eighth rank, becomes an all-conquering queen, the true monarch of the game. Who really holds power – Hamm or Clov?

As always with Beckett, there is no easy key to understanding. Chess is clearly a subtext of Endgame – his biographer Deirdre Bair says Beckett was clear on this point – but it is difficult to be reductive. Are Nagg and Nell, trapped in their dustbins, pieces that have been dispensed with to save the king? And when Hamm cries out, in an echo of Shakespeare's Richard III, "My kingdom for a nightman," should we take that as a reference to the knight in chess? Beckett once said the pun was accidental, but a knight – eccentric, dynamic, able to unlock closed positions – is just what the stasis of this endgame needs.

Commentators have suggested that Beckett was intrigued by chess because of the way it combined the free play of imagination with a rigid set of rules, presenting what the editors of the Faber Companion to Samuel Beckett call a "paradox of freedom and restriction". That is a very Beckettian notion: the idea that we are simultaneously free and unfree, capable of beauty yet doomed. Chess, especially in the endgame when the board's opening symmetry has been wrecked and the courtiers eliminated, represents life reduced to essentials – to a struggle to survive.

Friends of Beckett say he would often sit in a cafe moving objects on the table around as if playing a fantasy game of chess. Photograph: Ian Dryden/Rex Features

The influence of chess is especially apparent in Beckett's earlier work, particularly in Murphy, his first published novel. He had originally wanted the cover of Murphy to be a drawing of two chess-playing chimps, which he had seen in a newspaper, but the publisher vetoed the idea (one of the rare occasions when Beckett did not get his way). At the end of the book, Murphy – a drifter based to a large extent on Beckett himself – plays a fatal game against Mr Endon, who despite (or probably because of) being mad, has an aesthetically attractive style, full of repetitions and reversals, which Murphy realises he will never be able to match, forcing him into the ultimate form of resignation – suicide.

Beckett annotates the game, the moves of which are ridiculous in chess terms, in a flowery, rhetorical style typical of 19th-century chess books. "A coup de repos long overdue," he says of one passive move by white; "the flag of distress," he exclaims of another; "the ingenuity of despair," he writes after an abortive attempt at a queen sacrifice. For Mr Endon, who always played black, the narrator has only praise: "exquisitely played," he says of move 22; "black now has an irresistible game" is the comment after move 27.

After move 43, in which the black king returns to the back rank (though on the queen's original square), leaving Mr Endon's pieces virtually where they began while Murphy's army is raggedly dispersed across the board, the latter submits. "Further solicitation would be frivolous and vexatious," says the narrator, "and Murphy, with fool's mate in his soul, retires."

As I re-read Murphy, I find myself wondering whether the hero's name could be an allusion to the great 19th-century chess player Paul Morphy, a dazzling, New Orleans-born player who by the 1850s had established himself as one of the greatest the game had ever known, only to retire abruptly in his early 20s and withdraw from the world. Morphy, who would have been a worthy opponent for Mr Endon, drowned in the bath, and for a long time was thought to have committed suicide. Beckett would have appreciated both Morphy's genius and his willingness to negate it; he may have loved games, but he was all too aware of the delusion that they meant something.