Ben Schwartz, the actor and comedian, dunked the ball without looking at the joystick. “This is just like muscle memory,” he said.

On a frosty Monday afternoon, Mr. Schwartz had sneaked away from publicity rounds for an hour of arcade games at Barcade in the East Village of Manhattan. A few day drinkers slouched on bar stools, but Mr. Schwartz, 38, had the run of the machines.

“Playing video games by myself makes me happy,” he said.

Raised in the Riverdale section of the Bronx, he spent much of his childhood hunched over a controller. On weekends, he and friends would go to the local Nathan’s, spending the day playing arcade games and scarfing hot dogs. Did it impress girls? “Are you crazy?” Mr. Schwartz said. “Almost nothing I did impressed anyone.”

Then his parents bought a Super Nintendo and he could play video games at home. “I was, like, addicted,” he said. “I loved it so much.” He still loves it.

“Mom, can I have quarters?” he asked, turning to his publicist.

Mr. Schwartz, who won an Emmy for co-writing Hugh Jackman’s opening number at the 2009 Oscars, wore a polka-dotted shirt buttoned to the neck and basketball-print socks under spotless white Nikes.

An urban Peter Pan, he specializes in portraying young men who can’t or won’t grow up. He played the incorrigible rich kid Jean-Ralphio in the sitcom “Parks and Recreation,” and a pushy spin doctor in the management consultant drama “House of Lies.” A popular voice actor, he also plays characters in “Duck Tales” and “Rise of the Teenage Mutant Ninja Turtles.”

He has also voiced a video game character, Skidmark, a blue snail in the game Turbo: Super Stunt Squad, as well as the title character in the movie “Sonic the Hedgehog,” adapted from the Sega game. “Nobody cares about my face,” he said.

Grinning and pale, like a friendly ghost with good hair, he arrived a few minutes after noon and toured Barcade in search of the Sonic game. When the first trailer for “Sonic” was released last year, fans reacted to the character’s design with horror, singling out the teeth (so many!) and the legs (so disproportionately long!). Sonic 2.0 looks more cartoonish, like the original arcade game. “The newer design fits better,” Mr. Schwartz said. “It looks way more like me.”

The bar didn’t have Sonic so he began with a 1980s arcade game called Tapper, in which the player is a bartender serving beer to thirsty patrons. “This I have history with,” he said.

Eyes glittering with reflected pixels, he began slinging frosty mugs, first in a saloon and then in a stadium, nailing the bonus round. “I can’t tell if it’s embarrassing for me to be very good at this,” he said. As the game progressed, the pixelated customers grew more demanding. “It is probably not teaching kids good values,” he said. Having whiffed the second bonus round, he walked away with several lives remaining.

“As a kid I never would have left a quarter in the machine,” he said. “Sacrilege. Truly sacrilege.”

Onscreen, Mr. Schwartz often plays characters who project a boundless and mostly undeserved confidence. But when it comes to arcade games, the prowess is real. Growing up, he devoted himself to a game until he mastered it, which Mr. Schwartz, a former psychology and anthropology double major, blames on mild strain of obsessive-compulsive disorder. “When I start something, I really want to finish, which has helped me in writing and stuff,” he said.

After graduating from Union College (he wore a Super Nintendo controller over his gown), he worked as a page on the “Late Show With David Letterman” and as an intern at the Upright Citizens Brigade so he could afford to take improv classes. He spent his free time writing jokes, 10 per day, which were mostly rejected.

These days, he still writes, acts and improvises. In 2008, he joined comedic forces with Thomas Middleditch, the geeky star of “Silicon Valley,” and created a two-man improvisational show. “We played Carnegie Hall,” he said. “Crazy.”

Bounding to the back of the bar, he sped through a round of the driving game Championship Sprint, battled Street Fighter: The Movie, and ventured inside the pinball game Alice Cooper’s Nightmare Castle. “You’re a regular ghostbuster, aren’t you?” the game said, as Mr. Schwartz scored a multiball.

He bypassed Michael Jackson’s Moonwalker (“Can’t separate the art from the artist,” he said) and instead applied himself to Teenage Mutant Ninja Turtles: Turtles in Time. He played as Leonardo, the character he voices, defeating foot soldiers as he marauded through a dystopian New York. “Before Giuliani,” Mr. Schwartz said.

His assistant brought a cup of green tea and he left Leonardo to his travails. “We have unlimited coins,” he said, a little wistfully. “We could go forever.”

With his hour nearly up, he attempted a few levels of The Simpsons, playing as Homer, mashing the buttons with impossible speed. “Imagine being able to play your favorite character from your favorite show,” he said, as Homer stole a hot dog from a small child. “Like imagine you could play Elisabeth Moss from ‘Handmaid’s Tale.’”

For his final game, he put a quarter into NBA Jam, playing as Anthony Mason alongside Patrick Ewing. “He’s on my socks,” Mr. Schwartz said proudly, as he maneuvered his players up and down the court effortlessly, swooshing three-pointers. “I still got it. After all these years, maybe this is what I’m born to do, and the other stuff had just been wasting time.”