In Mansfield, Ohio, 1962, police set up hidden cameras in a public bathroom to record consensual sexual activity between men. An artist named William E Jones, who was born in Ohio that same year, later found the footage online, edited out a voiceover that he described as “as illiterate and hateful a text as I have ever heard committed to film”, and released the result in 2007 as a “found footage” documentary called Tearoom (US slang for a public bathroom in which men meet to have anonymous sex).

The footage reveals the men involved were diverse in appearance – and presumably background – but all were wary. And with good reason: many of them were later arrested. Public bathrooms have long been a battlefield where LGBT people are targeted by the law.

Robert Yang is an indie game developer and artist who has released a number of short, often funny games about gay sex and culture: Cobra Club is a dick pic simulator, Hurt Me Plenty explores consent and BDSM, and Succulent is inspired by “homo hop” music videos. His latest game, The Tearoom, is about the experience portrayed in Jones’s documentary: cruising public toilets for anonymous sex. Your goal is to engage in sexual acts with other men, but before that, you must wait for someone to enter, and then engage in a ritual that involves repeated periods of prolonged eye contact, all the while keeping an look out for the police.

“A lot of it is based on this sociological study by Laud Humphreys called Tearoom Trade,” says Yang. “[He] actually calls it a game, and tries to write out what the rules are and stuff, so it’s almost like a game design document. A lot of it is eye contact, so they’ll be peeing and then they might look at you and then you look at them, and then you look away and then they look away ... stuff like that.”

Facebook Twitter Pinterest Stealth-genre subversion … large icons clearly indicate when it is or isn’t appropriate to look towards the man at the other urinal. Photograph: Robert Yang

In the game, large icons clearly indicate when it is or isn’t appropriate to look towards the man at the other urinal. It’s like a subversion of the stealth genre, as this time you want to be seen (though not by the cops). Yang wrote on his blog that this mechanic was difficult to design because – as he puts it – “decades of male heterosexual hegemony have trained gamers into thinking of ‘looking’ as a ‘free’ action, with few consequences or results.” Players who are used to works that pander to the straight male gaze may struggle to empathise with someone for whom a glance may be punished.

If the other man doesn’t want to be looked at, a red eye with a line through it appears on screen. The player cannot move away from the urinal, so the only actions available to them when not soliciting or engaging in sex are to look around, perhaps glancing out of the window to check for cop cars, or to pee. Ironically, Yang wanted to create his “technologically advanced urinal” (which you can aim a stream of urine into and also flush) as a response to the habit other video games have of providing bathrooms that serve no purpose. “The funny thing is,” he says, “with tearooms you’re not there to pee at all. Peeing is a pretence. Peeing is your plausible deniability as to why you’re there.” If the object of your gaze is interested, however, enough careful eye contact fills a bar above his head, and he’ll abandon the urinal and approach the camera. The player’s perspective then shifts to crotch height ... Here is where Yang’s representation becomes more abstract. For one thing, a video game representation of oral sex is a difficult proposition. In fact, sex in general remains a problem for game designers – titles such as Heavy Rain, The Witcher 3 and the Mass Effect series have featured sex, but the awkward character models often make the scenes look ridiculous. In GTA V you can pay a sex worker for a blowjob but the camera only shows your character’s hand holding her hair as he moves her head. Smaller, independent games tend to do better when they abstract things, as with the pixelated vulvas players are invited to stimulate in La Petite Mort.

“[In a game] it’s hard to feel when you’re being penetrated,” says Yang, “Whether orally or anything. If I had some kind of phallic object moving towards the camera, it’s just going to disappear or something, right?

“I tried to look at some sex games to see how they do this, and they’re much worse at embodiment, because it’s less about you being there and more you being a director, creating some kind of scene and watching it from afar.”

Yang’s concession is to have a flapping tongue appear at the bottom of the screen, which the player must apply to various points on the other man’s appendage. And there’s the other departure: instead of penises, these men sport a variety of flesh-coloured guns.

Facebook Twitter Pinterest Yet more guns in video games. Photograph: Robert Yang

There’s an obvious parallel here, with video game guns as phallic objects permanently attached to your character (especially in early first-person shooters, where the gun was all you could see of your avatar). But initially this dramatic decision was a response to Twitch banning streamers from broadcasting Yang’s previous games. “I thought I would just change my depiction of sexuality to something that video games and Twitch would never ban,” he says. At the time of writing, The Tearoom has not joined Twitch’s list of prohibited games.

Yang is also interested in the political implications, and in the “very strange relationship” that video games have with violence and gun culture. On his blog Yang also highlights the disconnect between how the US treats guns (eg with “open carry” laws) versus the depiction or display of genitals, especially if those genitals belong to a trans person.

The use of a variety of differently shaped guns instead of penises allows for a clear collection mechanic: in the parlance of Pokémon, you’ve gotta lick ‘em all. Besides encouraging the player to engage with the game for longer, the goal of collecting eight guns also gives you something to lose, as getting caught by the police wipes all of your progress.

While Yang admits he wanted to “fuck with” commenters on Steam who criticised his other games for being too easy, he also hopes to make players feel anxious about what they’ve got to lose.

Jones’s website is currently down, his film unavailable. Humphreys’ book costs £35 on Amazon. But Robert Yang’s game is free (or pay what you want), and with its interactive nature perhaps best positioned to give players some idea of the perils – both historical and frighteningly current – of existing outside of what those in power consider proper.

