Win to Exit

A character is trapped in a game, and the only way to escape is to win. A Holodeck Malfunction may be involved, and losing may make them Dead for Real.

The graphics of the videogame in question are usually either implausibly realistic or laughably primitive compared to those available in the real world at the time, depending on how out of touch the producers are.

Sister Trope to Trapped in TV Land and a Subtrope of Your Mind Makes It Real. Overlaps with Deep-Immersion Gaming in some ways. The main difference is that while Deep-Immersion Gaming is basically a variant form of an Imagine Spot, this trope involves the game becoming very real.

Anime and Manga

 * BALDR Force.exe is made of this trope.
 * In the Negima?! manga, due to a mischievous... something, Negi and friends are trapped in Chisame's video game.
 * To Love Ru had the characters get stuck in an RPG during the Trouble Quest arc. Later on, they voluntarily place themselves in a board game.
 * Due to Holodeck Malfunction, at least one of the 50 children in the Virtual Console "Cocoon" in the Detective Conan Non Serial Movie Phantom of Baker Street need to Win to Exit, or else their brains will be literally fried.
 * Hunter X Hunter had Greed Island, where the only way to pause the game was to advance your objectives by a certain amount. There are people who have actually settled down to live in the gameworld because they couldn't get that Last Lousy Point that they needed to escape.

Comic Books

 * Happens to Ellie Dee is an issue of the Cherry Comics. She ends up derezzing the video game's main character by having sex with him.
 * In the Doc Samson miniseries, Tina Punnett is trapped in a VR game that's been modified to cause psychosomatic damage to the player. To get out, she runs herself through with a sword, causing lots of pain but also causing the game to end.
 * There was this short series where this trope was inverted. Memory fails me, but the gist of it was, a super-hacker was forced to play against an AI in an old videogame. The AI rigged the game so there was absolutely no way it could ever lose... problem was, the game was fixed so the only way to end it was losing...

Fan Works

 * Sort of, in With Strings Attached. Although the Vasyn quest takes place across several real worlds, . He fixes things so that after Shag and Varx discover the truth, they still cannot pull the four out; the computer ice in between them and the return program won't melt until they bring the third piece of the Vasyn back to C'hou. But by then things have changed so considerably that they can't rescue the four anyway....

Film

 * Arcade features a video arcade named "Dante's Inferno", where a new virtual reality arcade game called, boringly enough, Arcade is being tested. If you lose, you're trapped inside the game. Turns out the game is Powered By a Forsaken Child.
 * Of course, turns out that the game also affects the real world. Even the console versions are able to interact with each other.
 * In The Dungeonmaster, the hero and his girlfriend get pulled into a computer game. If the hero wins the game, they'll both be freed. If they lose, he forfeits his girlfriend's soul.
 * In The Beach, Leonardo Di Caprio goes crazy and imagines the world as a blocky videogame.
 * Spencer in Freddys Dead the Final Nightmare gets stoned and sucked into a game and is promptly killed by Freddy and his custom "Power Glove".
 * In Tron, computer programmer Flynn gets kidnapped by the Master Control Program into the computer system and is forced to compete in video games. Tron Legacy (and the Tron 2.0 Alternate Continuity) kicks this up a notch or two with a different villain and such, but the premise stays the same.
 * Almost all of the film eXistenZ takes place in a virtual reality gameworld with assassins stalking the main characters.
 * In the Bishop Of Battle segment of the four-part film Nightmares, J. J. Cooney is trapped inside the eponymous video game, after failing to complete level 13 the game becomes real.
 * In the film Stay Alive, a group of beta testers realize that they are slowly dying off one by one in the exact same fashion that their avatars in the game they are testing die. It is later revealed that playing this game summons the ghost of a sociopathic killer who delights in killing you in the most horrendous ways possible.
 * In Inception, this is what the team realizes they have to do in order to escape Fisher's mind once they learn his subconscious has been militarized. Only by incepting Fisher and making him achieve catharsis can the team avoid being "killed" by the projections.
 * It should be noted that dying in a dream usually throws you out of the dream. If the dream is multiple-layered, it kicks you to the higher-level dream. However, if you take a powerful sedative, getting killed in a dream will send you to the deepest level possible - the Limbo, which directly taps into your subconsciousness. Since dreams in this film compress time, you can spend decades in Limbo in a span of five minutes of real-time.
 * The game in Spy Kids 3D requires this.

Literature

 * In Vivian Vande Velde's Heir Apparent, the main character is playing a virtual reality game at a sort of VR arcade, and becomes unable to quit when anti-videogame protesters damage the equipment -- interestingly, it has the opposite message from most trapped-in-a-videogame stories (i.e. videogames are harmless fun and the people who think they're evil are misguided and possibly even dangerous).
 * A rare boardgame example occurs in Harry Potter and The Philosopher's Stone, where Harry, Ron, and Hermione take the part of pieces on a chessboard and win to get to the next test protecting the stone.
 * The Jumanji game works that way in the Jumanji series.
 * Ditto for Zathura, from the same author.
 * In the Piers Anthony novel Killobyte the protagonists become stuck in a virtual reality MMORPG due to the interference of a hacker.
 * This is how the action gets started in Tad Williams' Otherland series. Kids around the world end up in mysterious comas, and the protagonists start to suspect that it has something to do with an online playground. Then they get caught themselves, and it becomes apparent that they only way to escape from the virtual world is to solve its mysteries (and possibly destroy it from the inside). The story contains no moralism whatsoever on computers and computer games; the Metaverse is simply another arena for human virtues and vices to take place.
 * In Sergey Lukyanenko's Labyrinth of Reflections trilogy, the Deep program puts a person into a state of hypnosis, during which he or she will perceive a poorly-rendered image on the screen as reality. The first person to use this was a man who randomly found the Deep program online and ran it. The program played a ten-second fractal-like video, after which the man started up Doom. To his horror, he found himself walking the corridors, shooting weapons, fighting monsters. No matter what he tried, he could not get himself to "awaken". After many hours of playing, he finally beat the game, at which point his subconsciousness allowed him to "exit". He found a nearly-broken keyboard and his own bloody hands (his own blood).

Live Action TV

 * The Stargate SG-1 episode "Avatar" featured Teal'c having to fight his way out of a virtual combat scenario. His subconscious, unfortunately, kept making his job harder.
 * Specifically, the game reset the scenario every time he lost, and adapted so that he couldn't rely on information gained from the previous run. It had a built in safety exit (getting to the elevator ended the scenario), but since Teal'c considered giving up equivalent to losing, the game would not let him escape without winning. Also, because part of him believed the Goa'uld would never really be defeated, the game kept cheating every time he should have won. Cardiac arrest would have eventually killed him in reality.
 * "Are You Afraid of the Dark" had an episode The Tale of the Renegade Virus where a VR game goes awry and if the main character doesn't beat it, the virus will literally invade his brain and take him over.
 * Subverted in the episode The Tale of The Pinball Wizard. A kid gets trapped in a pinball game, and he believes that to escape, he needs to win. Turns out, he's not quite so lucky, and it's implied that he's trapped there forever.
 * In the Star Trek the Next Generation episode A Fist Full Of Datas, the only way the holodeck would shut down is if Worf, Troi, Data, and Alexander were able to win a wild west shootout.
 * This is subverted in the Deep Space Nine episode "Move Along Home." After being cheated by Quark, a group of aliens from the Gamma Quadrant decide to show him "an honest game" that involves four playing pieces trying to make it "home" down a tiered board. Meanwhile, Sisko, Dax, Kira, and Bashir find themselves in a maze-like series of rooms, with strange puzzles and scenarios in each room and a figure of one of the aliens telling them to "move along home." They (as well as Quark) quickly realize that the four crew members are trapped in the game and assume that this trope is in effect. After several narrow escapes, they reach the last room- a shaking, cliff-filled cave. As they cross
 * Also subverted with the Deep Space Nine episode "Our Man Bashir." At the last minute, Bashir goes off the rails and deliberately loses, invoking a Nonstandard Game Over that the program hadn't accounted for, shutting it down and allowing him to free his friends.
 * The X Files episode "FPS" is built of this trope.
 * The "John Quixote" episode of Farscape had VR "game blobs". Dying inside of the game only returns you to the start of the level. The real problem was getting out of the game, as the exit trigger had been sabotaged. Chiana does mention, though, that brain damage resulting from the games is not unheard of.
 * In the War of the Worlds episode "Totally Real", the loser of the VR game lost his life. This turned out to be the entire point of the simulator's design.
 * Red Dwarf featured the virtual reality game ''"Better Than Life", which reads the user's subconscious and creates a perfect world where all their desires are realised. In-game effects won't harm you or kill you, it's just so convincing that most players don't even realise that they're playing a game, and stay plugged in until they starve to death.
 * Sub/averted in the episode Back to Reality, in which the crew think they've just been booted out of a game for dying, but have actually survived and are now suffering a hallucination which is designed to make them suicidal. Their hallucinating behaviour maps into real-world actions well enough that they almost kill themselves simultaneously in both worlds before the ship's computer pulls off a literal Deus Ex Machina.
 * Inverted in one Sy Fy movie (anyone remember the name?) in which a malfunction causes the video game boss to animate the motion-capture exoskeleton in the real world and go on a murderous rampage.
 * Estate of Panic: The show's winner is the only one seen actually leaving the house. Three of the losers are left trapped in the rooms, and the other three are escorted to some unknown place in the mansion by the butler.
 * Todays Special: Thanks to Waldo's "automatic wishing machine", the gang gets trapped in an 80's era video game called Monkey Maze. Averted in that they fail to make their way through but escape by wishing to be on the moon instead.

Tabletop Games

 * Used for the Climax of the Mutants and Masterminds adventure module, "Toys Will Be Toys".

Video Games

 * Metal Gear Solid Mobile, with the flimsiest of justifications.
 * Yu-Gi-Oh the Falsebound Kingdom subverts this. You beat the VR game's main villain about a third of the way through, only for the creator of the game to take over, delete the villain, and attack you from behind. In order to actually win, you need to break out of the game and enter the computer itself.
 * Inverted in the adventure game Gateway - there is a Virtual Reality casino that is actually a ruse set up by the Big Bad, who intends the player to always win and keep playing - therefore, the player must force themselves to lose..
 * In Persona 4 there's a dungeon based entirely on blocky classic Dragon Warrior-type graphics... since the characters are going inside the collective subconscious as represented by television and dealing with people's internal imaginations, comforts, and insecurities, this is pretty justified.
 * And that its Boss Battle allows for a Shout Out to the Game-play style of the first two Shin Megami Tensei games is the cherry on the cheesecake.
 * An optional side-quest in Knights of the Old Republic involves some Schmuck Bait in the form of an alien artifact. Opening it traps you with the prison's occupant whose mind is trapped inside, and whose body died long ago. However, your body is currently unoccupied. He challenges you to a game of riddles to see who gets dibs on the body.
 * Of course, the Brotherhood of Shadow Game Mod cranks this one up with a similar artifact. The Brotherhood wants the Player Character as the avatar of their Hive Mind, but first must conquer your mind to do it. Cue two massively trippy rounds of Battle in The Center of The Mind.
 * The base setting of Kid Chameleon, where the game boss of a new arcade in town has kidnapped several other players that have played it and it's up to you to enter the game and put an end to it.
 * Almost all of the rooms in Devil May Cry work this way, even in the series reboot.
 * Assassin's Creed Revelations: After the events of Brotherhood,

Web Original

 * Neo Quest II, but the entire game is a simulation of a computer, with bosses being viruses and the like...
 * Played with in Homestuck: At the end of a successful Sburb session, the players are allowed exit However,

Western Animation

 * This was the central idea behind Re Boot.
 * An episode of Danny Phantom had their goal being to prevent the villain from winning and thereby escaping to the internet; however, they still needed to win several of the levels to catch up with him.
 * Bizarrely, "access to the World Wide Web" was the game's reward.
 * In Darkwing Duck, the gizmo that turns real objects into video game objects breaks after letting DW and Quackerjack in, so they must beat the game to reach the default "exit door."
 * Fairly Oddparents once did a plot of this sort as a result of one of Timmy's wishes. Bizarrely, he specifically asked for "a game you can't wish yourself out of," for no apparent reason other than so this trope could happen (the concept of wishing oneself out of a video game being utterly meaningless in any other context). It was perfectly possible to leave the game by, uh, quitting... but none of them actually did this because Timmy couldn't warn the other players and he wouldn't abandon them.