Ed Helms voices the titular superhero, the product of a pair of friends’ imaginations, in the comedy based on Dav Pilkey’s books. (DreamWorks Animation)

You all should be ashamed of yourselves. Honestly, it is just so immature to giggle at toilet humor. If you don’t watch out, the evil Professor Poopypants may just zap the laughter lobes of your brains. You’ll never snicker at his name again. Or at anything else, for that matter.

Just goofing.    

Go ahead, take the kids and guffaw with them at the excretory humor (and other amusements) in “Captain Underpants: The First Epic Movie.” Director David Soren does a wondrous job of reproducing, in animated form, the riotous comedic sensibility of author and illustrator Dav Pilkey and his “Captain Underpants” books — right down to the squiggly lines and cutout look of the drawings. The plot of the movie pulls bits and pieces from the first four installments in Pilkey’s 12-book series, which is all about the adventures of fourth-grade pranksters George Beard (voiced by Kevin Hart) and Harold Hutchins (Thomas Middleditch) and their invented superhero, Captain Underpants.  

Soren and his animators soften the hard-plastic look of the characters’ CGI faces with a rubbery kind of humanity. “Captain Underpants” achieves a convincingly hand-drawn look in the characters’ chunky oval bodies, in the buildings they inhabit and in the backgrounds against which the action is set. 


Professor Poopypants (voiced by Nick Kroll) in “Captain Underpants: The First Epic Movie.” (DreamWorks Animation/Twentieth Century Fox Film)

Harold (voiced by Thomas Middleditch), left, and his friend George (Kevin Hart). (DreamWorks Animation/Twentieth Century Fox Film)

It positively bristles with humor to please all ages: A sign on the desk of George and Harold’s mean principal, Mr. Krupp (Ed Helms), reads “Hope Dies Here.” When he’s really angry, his toupee levitates a little. Kids march into the grim Jerome Horwitz Elementary School — where music and art classes have been canceled — like soul-dead citizens out of “1984.”  

Despite such regimentation, irreverence and a delirious disregard for all things orderly define George and Harold’s approach to life. They live next door to each other and hang out in George’s treehouse, where George makes up stories and Harold illustrates them. They create their own comic books, and their favorite original superhero is Captain Underpants, an egg-shaped do-gooder in immaculate tighty-whities and a cape — thank goodness this is animation — who looks and sounds, uncoincidentally, like Principal Krupp, only friendlier.

Director Soren’s 2013 animated fable “Turbo,” about a garden snail with a need for speed, was an underappreciated and equally offbeat ’toon. He’s the perfect person to adapt Pilkey’s work.


Harold, left, and George end up in the office of their principal, Mr. Krupp (Ed Helms). (DreamWorks Animation/Twentieth Century Fox Film)

Neither George nor Harold does all that well in school. They need a looser, more creative learning environment. Without that, they keep their sanity as merry pranksters: re-lettering school signs to say rude things and rejiggering an invention by their nerdy schoolmate Melvin (Jordan Peele) so that it fires toilet paper rolls at kids in assembly. 

Predictably, George and Harold land in Principal Krupp’s office a lot. When he threatens to put them in separate classes, the boys’ sheer horror at the prospect is expressed via a live-action melodrama, enacted by sock puppets.

But then, a kind of magic intervenes, when George manages to hypnotize Krupp with a plastic ring. Using posthypnotic suggestion, they get him to behave like their comic-book superhero, making the principal switch between Krupp and Captain Underpants with a dash of water in his face. When a new science teacher, rendered in the boys’ imagination as Professor Poopypants (Nick Kroll), announces his villainous intentions to eliminate all laughter, the boys and Captain Underpants must stop him.

There’s a blissful silliness to all this that works on adults and kids alike. George and Harold are tricksters, but they’re not cruel. They’re friendly to other kids and they even do a good deed for Principal Krupp, once he’s himself again. 

In an increasingly mean-spirited world, the spirit of fun and kindness in “Captain Underpants” is simply a tonic.

PG. At area theaters. Positively flush with mild toilet humor. 89 minutes.