LOS ANGELES — This is the story of how a gooey green guy in a microwave, a pagan witchdoctor with a beating heart in his hand and that unlucky numeral 13 changed the way Hollywood makes its movies.

It has been two decades since the summer of 1984, when “Gremlins” and “Indiana Jones and the Temple of Doom” caused an uproar among some parents who took their young children to the PG-rated films and walked out wishing the rating had suggested more guidance than just “parental guidance suggested.”

The solution became the PG-13 rating.

But instead of being solely an extra warning to parents, as it was originally conceived, it has evolved into the preferred rating of studios and filmmakers. As Steven Spielberg told The Associated Press recently, PG-13 puts “hot sauce” on a movie in the viewer’s mind.

The genesis of PG-13 is directly linked to Spielberg, who in 1984 became a lightning rod for parental ire.

“I created the problem and I also supplied the solution ... I invented the rating,” Spielberg, the producer of “Gremlins” and director of “Temple of Doom,” said in a recent interview.

With no middle-ground between PG and R, the ratings board of the 1980s frequently wrestled with the right way to classify movies that should and should not be viewed by children. The flaw in the Motion Picture Association of America’s rating system was that it lumped all children — from infants to 17-year-olds — into the same group.

Maybe the “Gremlin” who met his steaming, grisly demise inside that kitchen appliance, or the chest-popping human sacrifice that put the doom in “Temple of Doom,” were too graphic for grade-school kids, but what about the teenage couples looking for a scary reason to cuddle in the movie theater?

Ultimately, both movies made it to theaters with the PG designation.

I heart ‘Indiana Jones’After “Temple of Doom” opened May 23, some parents complained to theater managers and the ratings board that their kids were mortified, and news reports began questioning whether the ratings board was being too lax.

Jack Valenti, the longtime MPAA head who recently announced his retirement, told the AP that the heart scene was the catalyst. “By today’s standards it’s not a big deal,” he said. “But it was pretty off-putting. And there was a real problem about how to label that picture.”

“Everybody was screaming, screaming, screaming that it should have had an R-rating, and I didn’t agree,” Spielberg said.

The debate might have faded there if not for “Gremlins,” which came out two weeks later.

Joe Dante, the director of “Gremlins,” and later “Small Soldiers” and “Looney Tunes: Back in Action,” blames the backlash on the early trailers.

They focused mostly on Gizmo — a friendly, teddy bearlike creature called a Mogwai, which multiplies in water. But it neglected Gizmo’s clones, which go through a metamorphosis that turns them into ghoulish, murderous troublemakers.

Dante said the spots also were deliberately “imitating the color and style of the ‘E.T.’ ads” from two years earlier, hoping to draw people in based on Spielberg’s producer credit.

“So the idea of taking a 4-year-old to see ‘Gremlins,’ thinking it’s going to be a cuddly, funny animal movie and then seeing that it turns into a horror picture, I think people were upset,” Dante told the AP. “They felt like they had been sold something family friendly and it wasn’t entirely family friendly.”

But it still became a hit, collecting $150 million. “Temple of Doom” earned $180 million, proving there was an audience that loved movies that mixed wholesomeness with horror.

Clearly there would be more films like this. “There was no way of going back and making the content less hard, because people did expect certain things from these pictures and you had to give them those,” Dante said.

But there remained the problem of how to keep little kids away while attracting adults and teens.

Lucky number 13Spielberg thought it was an easy fix.

“I went to Jack Valenti, who’s a friend of mine, and I said, ‘Jack, why don’t we do a rating called PG-13, which would suit films like “Gremlins” and “Indy 2”?”’ Spielberg said. “So I called Jack, and Jack said, ‘Leave it to me ...”’

Valenti took the idea to the National Association of Theater Owners, Hollywood’s writer, actor and director guilds, the studio bosses, and assorted religious organizations.

“I didn’t seek their approval or anything,” Valenti said. “Didn’t have to. But I certainly conferred with all of them.”

He agreed to make the distinction at 13, saying that was an age when most kids knew the difference between fantasy and reality, and had more independence from their parents.

“The child behavioral experts will tell you that not all 13s are alike, not all 14s are alike, not all 12s are alike,” Valenti said. “In the end, as I have stated numberless times, it is the parent who has to make this judgment.”

Aug. 10, 1984 marked the first debut of a PG-13 movie: “Red Dawn,” about a Communist invasion of America and the high-school rebels who fight back. PG-13 ratings that year also went to the Gene Wilder comedy “The Woman in Red,” the sci-fi epic “Dune,” Matt Dillon’s “The Flamingo Kid” and the mob farce “Johnny Dangerously.”

New rating was freeingStudios and filmmakers did not view the new rating as a potential punishment. Rather, it was liberating, Dante said.

Dante recalled an old B-movie saying: “An older child will NOT watch anything a younger child will watch, but a younger child will watch ANYTHING that an older child will watch.”

That philosophy transformed the PG-13 rating into a marketing tool. It promised edge without threatening offense.

“In a way it’s better to get a PG-13 than a PG for certain movies,” Spielberg said. “Sometimes PG, unless it’s for an animated movie, it turns a lot of young people off. They think it’s going to be too below their radar and they tend to want to say, ’Well, PG-13 might have a little bit of hot sauce on it.”’

The disposable income teens spend coming back again and again to their favorite flicks is the fuel that keeps Hollywood running. Would they have flocked to “Pirates of the Caribbean: The Curse of the Black Pearl” in as many numbers if it had not been marked with the darker PG-13?

The PG-13 rated “Titanic” is the highest-grossing movie in history, and the top 10 includes four others — both “Spider-Man” movies, “The Lord of the Rings: The Return of the King” and “Jurassic Park.”

PG, meanwhile, runs the risk of suggesting blandness.

That’s the likely reason you’ll see Will Smith’s naked rear in “I, Robot,” Kirsten Dunst’s wet T-shirt in “Spider-Man,” or the joke in “The Terminal” about Tom Hank’s muddled English being mistaken for profanity.

Cutting those scenes may have improved the chances of getting PG ratings. But who wants that anymore?

“Kids don’t want to feel like they’re seeing pap,” Dante said. “People will go out of their way to put one dirty word in it just to get the rating that they need to give the picture some legitimacy, so the kids won’t feel like they’re going to see their little brother’s movie.”