You might think that in a town marketing its past, there would be plenty of room for Fred Bobrow’s Retro Arcade Museum, a nostalgic swath of analog pleasure in a digital world.

But then sometimes the only thing more retro than an old arcade is the working of local government. Or so Mr. Bobrow, 46, thinks as he leaves town, broke and disgusted, after building a business that mastered the electromechanical coils, buttons, switches and relays of old arcade machines but not, it seems, the gears of City Hall.

It did seem like a perfect match.

Once a raucous collection of hat factories and red brick warehouses, Beacon is now one of those would-be Brooklyns on the Hudson, selling art and a rehabbed, post-industrial downtown.

And Mr. Bobrow’s childhood infatuation with vintage arcade games never flagged.

First he bought one for his own use, then three, then five, eventually more than 150. In May 2008, he opened his Retro Arcade Museum on a sluggish corner of Main Street in Beacon, away from the hot spots on the east and west ends.

The place soon caught on; it was nostalgia for adults who remembered when, and revelation for younger visitors who had never been able to experience a place where games meant interacting with genuine humans in a public space.

Only four or five of the 50 machines in use at any time were classic pinball machines from the 1960s and 1970s. Some of them were early video games like Atari’s Pong and Nintendo’s Popeye. Others were just marvels of ingenuity and miniaturization, playing off baseball, submarines or Wild West shootouts.

It drew private birthday and anniversary parties, random fans, and classes from New York University, Vassar, Marist and other colleges.

“Fred was an excellent resource as a host, tutor and mentor,” said Brett Phares, who teaches courses on interactive media and game studies at Marist. “He’d do anything he could to make sure you connected with the experience.”

Mr. Bobrow charged a flat fee for groups from the start and then added a $10-per-hour-per-visitor charge with unlimited plays — more or less on the honor system.Open for two years, the Retro Arcade Museum in Beacon, N.Y., eventually fell victim to a city ban on amusement arcades, which has since been eased.CreditChris Ramirez for The New York Times

Local inns and bed-and-breakfasts recommended it to customers. People came from around the country, Europe, Japan. He got rave reviews from customers, and growing online buzz.

And then, like the last ball sliding between the flippers, it was game over. The city building inspector notified him in June that the business was being closed down because the city had an ordinance banning amusement arcades.

Mayor Steve K. Gold said that the museum was an enormous asset to Beacon, but that laws could not be selectively enforced.

Timothy Dexter, the building inspector and zoning administrator, said that Mr. Bobrow’s business was out of compliance from the start and that inspectors took notice only after reading a newspaper article about the museum last spring.

He said Mr. Bobrow erred in not inquiring about the legality of the business before he opened it.

“It’s unfortunate,” Mr. Dexter said, “but ignorance of the law is no excuse.”

A charitable reading would be of lots of good intentions gone awry, beginning with Mr. Bobrow, who was clearly more knowledgeable and passionate about Desert Fox and Night Bomber than about local zoning.

Mr. Gold said he had sought to work with Mr. Bobrow, find a new space and pass a new law, but Mr. Dexter said Mr. Bobrow’s best bet would have been to apply to the local zoning board of appeals for a variance allowing him to stay open, rather than to wait for a new law.

WHATEVER the case, the City Council this month passed a new ordinance allowing arcades, under certain circumstances. It was too late.

Mr. Bobrow says that after being closed for three months and having to repay deposits from customers, he is now broke. He is selling his house and liquidating his collection. The storefront is now one more vacant one, and you can bet that Beacon won’t find a similar attraction to replace the museum.

It appears that Beacon turned a distinctive attraction into a lose-lose for all concerned.

“You can’t shut a business down for three months, especially in the summer, and expect it to survive,” Mr. Bobrow said.

“It’s been sad and kind of pathetic. For me, this was something that made me happy and made other people happy, and it turned into this insanity. I guess no good deed goes unpunished.”