The writer and directorRick Famuyiwa’s three previous films have been commercially successful—each of them low-budget but grossing more than $20 million at the box office.  His fourth and latest, “Dope,” a comedy about a black high-school student, a self-proclaimed geek who is accidentally drawn into a drug deal, seems on track to become a success of a different order. One of the hits of this year’s Sundance Film Festival, it opens on June 19th across the country, not in limited release as most indies do. Asked why this seems to be his breakout movie, Mr. Famuyiwa said, “I consider ‘Dope’ a part of the new mainstream. I think the younger generation’s view on race is slightly more evolved. It’s a category far down on the list of how they see themselves.”  Mr. Famuyiwa’s films all pointedly defy racial stereotypes, particularly the cliché of the thuggish black man. In his first movie, “The Wood” (1999), young middle-class black men try to get their friend, a reluctant groom, to the wedding. “Our Family Wedding” (2010) is a comedy about two affluent families, one Mexican-American and one African-American, whose children are getting married.  In “Dope,” Malcolm (Shameik Moore) and his two nerdy best friends—the lesbian Diggy (Kiersey Clemons) and the multiracial Jig (Tony Revolori, the Lobby Boy from “Grand Budapest Hotel”)—live in today’s world of cellphones and texting but are obsessed with ’90s hip-hop culture. The movie becomes a high-energy caper when a dealer hides drugs in Malcolm’s backpack, and he has to find a way not to be killed and still make it to an interview that might get him into Harvard.  “Dope,” like “The Wood,” is set in Mr. Famuyiwa’s own rough childhood neighborhood in Inglewood, Calif., where he grew up the son of an engineer and a lab technician, Nigerian immigrants who came to the U.S. on student visas. Mr. Famuyiwa, who is 41, says, “I remember growing up watching John Hughes movies and watching these white kids from suburban Chicago. I connected to them even though I didn’t live in their environment. The same can be said of ‘Dope,’ in that white suburban Chicago kids can feel like it resonates with their life. The film connects to what we all went through or are going through in adolescence.”  He chose hip-hop as his characters’ obsession partly because that was the era he grew up in. “I feel like that era in music ushered in pop culture as we know it today.” Mentioning contemporary musicians such as Kendrick Lamar and the rapper A$AP Rocky, who plays the drug dealer in “Dope,” Mr. Famuyiwa said, “Listening to young artists, I wanted to deal with the voice I was hearing but also tie it into the era that was influential in giving them that voice.”  Malcolm and his friends have a band called Awreeoh (pronounced Oreo). The invented group’s music was produced by Pharrell Williams, who curated the soundtrack, wrote four songs and is an executive producer of the film. Forest Whitaker, who starred in “Our Family Wedding,” is one of the main producers. Even with those names attached, the project failed to get studio funding.  “It wasn’t something they could easily categorize, there was no easy way to sell it. In some ways it had to be made outside the system,” Mr. Famuyiwa said. But he sees other reasons Hollywood was reluctant. “In many ways the film business is behind what’s going on culturally. We are a world that is becoming more diverse and there’s no going back. It’s not even about doing it just for moral reasons. Business-wise, it makes sense to make films that reflect more than one experience,” he says, pointing to the multiracial “Fast and Furious” franchise as an example.  “The Wood” included more autobiographical details, but “Dope” truly reflects his personality, he said. “Malcolm, in spirit and in that idea of not quite fitting in and not wanting to be defined or categorized, is very much like who I was growing up and who I am today.” Mr. Famuyiwa went to the University of Southern California, and the film is a what-if scenario drawn from his youth.  A scene in which Malcolm meets Dom, the drug dealer, was spurred by a real event. Like Malcolm, he was riding his bike past some dangerous guys in his neighborhood when one of them called him over. Mr. Famuyiwa said, “I’m thinking, ‘What is he going to ask me to do? Take a package or whatever?’ ” Instead, the dealer asked him to take a message to a pretty girl across the street (Zoë Kravitz plays her fictional counterpart). Mr. Famuyiwa didn't end that day at a drug dealer’s birthday party, as Malcolm does, but the incident inspired the film. “That was the first scene I wrote. I started thinking about how that situation could have spun into something crazy.”  Mr. Famuyiwa is about to start directing “Confirmation,” an HBO film about the 1991 Supreme Court confirmation hearings. Kerry Washington plays Anita Hill, who accused Clarence Thomas (Wendell Pierce) of sexual harassment. “It’s about digging into that confirmation process,” Mr. Famuyiwa said. “Racial politics, gender politics and the 24-hour news cycle were all converging in the lives of these two people. Whatever happened with them 10 years prior, they had their lives thrown in the public eye in a way that most people obviously don’t. They’re connected in that way forever.”
In “Dope,” Rick Famuyiwa gets help from Pharrell Williams and Zoë Kravitz. Next up for the director: Kerry Washington as Anita Hill, Wendell Pierce as Clarence Thomas for HBO.