In “That Dragon, Cancer,” the video-game developer Ryan Green confronts his son’s terminal illness using the medium he knows best.

The film “Thank You for Playing,” which premièred at this year’s Tribeca Film Festival, follows a young father who is making a video game about his terminally ill child. Joel Green was diagnosed with terminal cancer in 2010, at the age of one. By the time the film’s directors, David Osit and Malika Zouhali-Worrall, first met him, in early 2013, Joel’s young body had been subject to more than three years of surgery and chemotherapy. The tumors had left him partially deaf and blind. At one point, he had to relearn how to walk. Other families might document and express a similar experience through photographs, home videos, written diaries, or poems. But Joel’s father, Ryan Green, is a video-game developer, and he decided to bring narrative order to the devastating chaos of his son’s illness using the medium he knows best.

Video games often provide a form of escape, both for their players and, at times, for their designers. But for Green “That Dragon, Cancer,” as his game is called, served an opposite purpose—as a way to invite others to share his real-life experience. An early demo of the game, released a few months after Green and his friend and development partner Josh Larson began work on it, in November of 2012, held nothing back in its depiction of the family’s plight. In one vignette, you sit, as Green once did, in a hospital room, which is quiet apart from the hum of inscrutable machines and Joel’s haunting screams. The game’s style is impressionistic (there are no features, for instance, on the face of Joel’s avatar), but the effect of a baby’s cries is undiminished in a virtual world. In video games, we have grown used to confronting the problems their designers present and solving them with relative ease, often via a gun’s sights, a shunted block, or a virtual key. In this scene, the problem is inescapable, and the sense of anguish when your attempts to calm Joel fail is grimly authentic. As the young boy bangs his head against the rails of his narrow cot, you hunt in vain for a button that might make it all stop.

“It’s important to me that, when I’m speaking about my journey, that I’m doing it from a ‘now’ perspective,” Green told me in 2013, when I first played the demo. “You get a lot of wisdom in the pressure cooker. I like to think of this as a cup of water. I want to scoop it up and hand it down to someone to drink. I think I can do that more effectively in the middle of this thing than afterwards. I’m not trying to create rules for people to follow when dealing with cancer, or some potentially damaging platitude. This game is just a reflection of how I see the world, of my story.”

Osit and Zouhali-Worrall first visited the Greens, at their home in Colorado, in the spring of 2013, after reading a brief news item about the game. “When we first starting filming, Joel’s health was relatively stable,” Osit told me. “Then new tumors grew and it deteriorated. But by that point we had become close with the family and were committed to telling their story.” The Greens allowed the filmmakers months of unrestricted access. Some of the scenes they captured are comfortingly mundane: family meals, sessions recording the Greens’ voices for use in the game. Others are unimaginably intimate: the invasive medical procedures, the fraught conversations between a father and mother bewildered with grief. “Perhaps because they saw the documentary as sharing their mission to create dialogue and discussion around taboo topics like death and bereavement, they never told us to turn the cameras off,” Zouhali-Worrall said.

For Osit and Zouhali-Worrall, whose previous work includes “Call Me Kuchu,” a documentary depicting the final year in the life of the Ugandan gay-rights activist David Kato, making “Thank You for Playing” has illuminated the respective strengths of two mediums. The filmmakers were able to examine not only the Green family’s experience of Joel’s illness but also Ryan Green’s attempt to express his grief through art; their movie is, in the end, a documentary about the making of a documentary. But where the film gains richness through layers of storytelling, “That Dragon, Cancer” gives players the opportunity to set the pace of the narrative themselves. Zouhali-Worrall cited one portion of the game, set in a playground, where players can push Joel on a swing. “Nothing happens; you just hear Joel’s laughter,” she said. “Time and again, I’ve watched people just stay there, quietly pushing Joel’s avatar on the swing. That opportunity to linger can be profound.”

On March 14, 2014, in the early hours of the morning, Joel Green died.* He was five years old. When I heard the news, I grieved. I had been there, in the room, when Joel was unable to find respite from the pain; I had been broken by his interminable anguish and, finally, overwhelmed with relief when he finally found rest in his hospital cot. The news that his young life had ended—news of a death on the other side of the world from me, in a family with whom I had no real connection—was devastating. I thought about the family regularly in the following weeks and months.

Josh Larson told me that Joel’s passing caused him and Green to reëvaluate their vision for the game, which is due to be released later this year. “We decided to focus more on who Joel was and what it was like to be with him and to love him,” he said. In one new sequence, the Greens are feeding bread to ducks at a pond when Joel throws a whole loaf into the water. Only Joel is seen on screen here, while, in the soundtrack, we hear Green and his wife, Amy, discussing their memory of the moment with their surviving sons. Referring to the game’s evolution, Green told me, “We moved from focussing on the plot of Joel to focussing on the character of Joel.”

For Green, in other words, the game is no longer just a way to invite others into the dreadful realm of terminal illness; it’s also a way to preserve, and to celebrate, the memory of his son’s life. “I want the game to capture the way Joel danced,” he said. “The way he laughed. The way his brothers treated one another. The affection they have. I want to put those things in the game. He was the sweetest kid. I can’t really articulate…. I hope to capture some of that, something of who he was and is. In the end, I guess my greatest hope is pretty simple: that players might care about my son the way that I do.”

*An earlier version of this post mistakenly cited March 15, 2014, as the date of Joel Green’s death.