MILWAUKEE — A Wisconsin county is likely violating the U.S. Constitution’s free-speech protection with its requirement that game developers obtain permits for augmented-reality apps like Pokemon Go to be played in parks, a federal judge says.

Wisconsin U.S. District Judge J.P. Stadtmueller ruled Thursday that Milwaukee County can’t enforce the ordinance while a lawsuit over it moves forward. Irvine, California-based game developer Candy Lab Inc., which is working on a poker game that would be affected by the county’s ordinance, sued to overturn it.

Milwaukee County passed the permitting requirement in February in response to the large crowds that Pokemon Go attracted last summer to a park along Lake Michigan. Officials said the sudden influx of people left the park trash-ridden and the county had to pay for the cleanup.

The ordinance requires that developers apply for and obtain a permit like any other business or group that wants to host park events. The money is for the park’s upkeep and the permits are supposed to help the county prepare for the volume of people

In the ruling, the judge criticized the ordinance “for its strangeness and lack of sophistication” because it treats game developers “as though they are trying to hold an ‘event’ in a Milwaukee County park.”

“However, this misunderstands the nature of the problem, since Candy Lab’s video game will not be played at a discrete time or location within a park,” Stadtmueller wrote. He suggested a better alternative would be to punish gamers who violate park rules.

Milwaukee County can’t comment on pending litigation, spokeswoman Melissa Baldauff said. But the county has argued in court filings that augmented-reality games are not protected speech under the Constitution.

The sponsor of the ordinance, County Supervisor Sheldon Wasserman, said Friday he’s confident the law will be upheld.

“We’re dealing with a government’s ability to control its own neighborhood,” he said.

The game Candy Lab is developing is called Texas Rope ‘Em, a variation of the poker game Texas Hold ’em. Gamers are directed to different places to pick up cards and build a five-card hand to play against a computer-controlled dealer. Cities the game is being tested in include Milwaukee.