Maybe Warner Bros. Pictures, keeper of the DC Comics movie legacy, is finally figuring out that comic-book movies are supposed to be fun, and the delightfully loopy, happily exuberant “Shazam!” is the beneficiary.

The story takes the wish-fulfillment story every adolescent comic-book reader asks — wouldn’t it be cool to be a superhero? — and takes it to its most absurd conclusion. After all, how complicated would life get for a 14-year-old who suddenly became a superhero?

Life is already complicated for Billy Batson (played by “Andi Mack” co-star Asher Angel), a street-smart orphan in Philadelphia. Billy lives by his wits, boosting police cars so he can track down addresses to find the mother who he lost touch with at age 3. When Billy gets caught, he’s assigned to a group home run by the loving Rosa (Maria Milans) and Victor (Cooper Andrews).

The other kids are a wide array of ages and temperaments, and Billy is immediately paired with Freddy Freeman (Jack Dylan Grazer, from “It”), a wise-cracking superhero expert who uses a crutch to walk. Freddy is the constant target of the bullies at Fawcett Central High School (the name is a sly reference to Fawcett Comics, the comic’s original publisher), and when Billy defends Freddy, he has to flee to the subway to keep from getting pummeled.

In the subway, though, Billy is led to an underground lair, where an aged wizard (Djimon Hounsou) has waited centuries to bestow magical powers to a person of pure heart. But the wizard is out of time, because the forces of evil — the seven deadly sins — that the wizard is tasked to contain have broken free, into the body of Dr. Thaddeus Savina (played by go-to baddie Mark Strong).

The wizard tells Billy to say his name: Shazam. (Fun fact: The word is actually an acronym for the greats of mythology: Solomon, Hercules, Atlas, Zeus, Achilles and Mercury.) When Billy says the magic word, he transforms into an adult-sized man with superhuman strength, played by Zachary Levi. The bulked-up Billy needs Freddy to figure out this superhero stuff, like the range of his powers, which include hurling lightning bolts, running really fast and being bulletproof.

The only thing this superhero doesn’t have is a name. There’s a running gag where Freddy tries to give an appropriate name to this white-caped hero, but fails in every attempt. (In the comics he was originally called Captain Marvel, but he lost that name in trademark disputes with Marvel Comics. You may have noticed a different “Captain Marvel” movie in theaters right now.)

Screenwriter Henry Gayden (“Earth to Echo”), who shares story credit with Darren Lemke, mixes elements of “Big” and “The Greatest American Hero” into this superhero origin story, as Billy simultaneously must face sudden adulthood and sudden superpowers. There’s a surprising emotional weight to the story, as Billy also contends with the responsibilities of his status as a superhero and as a foster brother.

Director David F. Sandberg, whose career grounding is in horror (“Lights Out,” “Annabelle: Creation”), gives Strong’s Sivana just enough of a creepy air to make the ultimate super-showdown exciting. Mostly, he plays up the absurdity of superheroes, which plays well into Levi’s flair for comedy. This superhero has great power, and great responsibility, but “Shazam!” wears it lightly and humorously.

(Steve Wilkie | DC Comics/New Line Cinema/Warner Bros. Pictures) Superhero Shazam (Zachary Levi, left) and pal Freddy Freeman (Jack Dylan Grazer) have some soda in "Shazam!," based on the DC Comics hero.

——

★★★1/2

‘Shazam!’

The other “Captain Marvel” (not that anybody calls him that any more) gets a boisterous, hilarious origin movie.

  • Where • Theaters everywhere.
  • When • Opens Friday, April 5.
  • Rated • PG-13 for intense sequences of action, language, and suggestive material.
  • Running time • 132 minutes.