Binti, a 16-year-old girl, is the first person from her Himba ethnic group to be accepted into the prestigious intergalactic university Oomza Uni. Trouble starts at the launch port when people can’t understand why she daubs her hair in red clay as the Himba people of northern Namibia do. Things only get worse when the transport ship is attacked by alien jellyfish and Binti must draw on her people’s ancient knowledge to make peace.

Part one of a trilogy by Nigerian-American author Nnedi Okorafor, Binti is being adapted for television by Hulu, the Walt Disney-owned streaming channel. Its success is part of a wave of Afrofuturism or, more specifically, Africanfuturism, a term coined by Okorafor to plant it more firmly in the African — as opposed to the African-American — experience.

Africanfuturism, at least in Okorafor’s hands, draws heavily on magic, myth and a pantheon of Nigerian spirits as well as tropes from science fiction. It is part of a tradition of art, literature and music that includes the jazz musician Sun Ra, who wrote songs such as “Tapestry from an Asteroid”, and Octavia Butler, whose novel Kindred blended slave narratives with time travel.

You could call it escapism, but Okorafor defines Africanfuturism as being “less concerned with ‘what could have been’ and more concerned with ‘what is and can/will be’.” Things don’t always go smoothly. In Okorafor’s Lagoon, aliens invade Lagos, the commercial capital of Nigeria, and Legba, a Yoruba god, shows up as a “419 scammer” as Nigerian fraudsters are sometimes known.

John Jennings, who is curating a series of books for US publisher Abrams dedicated to “black speculative fiction”, calls Martin Luther King an Afrofuturist. “The mountaintop that Dr King spoke about does not exist in this universe,” he told the New York Times. “It’s an imaginary construct of what the future could be.”

Kwame Nkrumah, Ghana’s liberation hero, was another leader who dreamt of a different reality, in his case a pan-African one. Less good at handling the present — he drove the economy to ruin and was ousted in a coup in 1966 — Nkrumah’s vision is coming to a kind of fruition in the continent’s collective handling of the Covid-19 crisis and its formation of a 54-nation free-trade area.

Afrofuturism’s big commercial breakthrough came, of course, with Black Panther, the 2018 American superhero adventure adapted from Marvel comic. Set in the scientifically advanced, never-colonised, fictional country of Wakanda, it gained huge box office success partly because it both celebrated and ignored blackness. “[It] wasn’t a film about black people,” enthused one viewer. “It was a Hollywood film that starred people that looked like me.”

For Patrick Gathara, a Kenyan cartoonist and political critic, having black people depicted on the big screen is not enough. Far from offering a “redemptive counter-mythology”, he writes, Black Panther’s depiction of Africa differs little from the colonial view. Wakanda’s success owes less to the ingenuity of its people and more to a lucky meteor strike that brought the vibranium metal on which its technological prowess depends, he says. Nor has Wakanda developed thinkers capable of taking it beyond a feudalistic system of royalty and warriors or of devising a way of transferring power without mortal combat or violent overthrow.

The African-American historian Clarence Walker warns against a rose-tinted Afrocentrism in which, he says, complex history is replaced with feel-good myths and the idea that everyone is descended from royalty. “If everybody was a king, who built the pyramids?” he asks.

The search for an alternative future need not start in a glorified past. It can begin with the real one. You do not need to ignore the brute realities of history — whether in Africa, Europe, China or the Americas — to recognise the achievements of antiquity.

The Kingdom of Kush, founded in modern-day Sudan some 3,000 years ago, the 13th-century bronzes of Benin or the breathtaking rock-hewn churches of Ethiopia — like Wakanda, never colonised — are the match of anywhere. Ancient Egypt, too, was African, notwithstanding the efforts of many historians to sever it from a supposedly distinct sub-Saharan civilisation.

Zainab Badawi, a Sudanese-British broadcaster who spent years making The History of Africa, a BBC television series that plots the great moments and themes of the continent’s past, says ignorance about Africa’s history remains. But on the continent itself, she senses a greater recognition “that Africa has institutions, has a heritage, has a culture, has an indigenous knowledge system that is worthy of study, worthy of respect and preservation — and adaptation to the modern era”.

Africanfuturism, even with its spaceships and intergalactic heroines, is a small part of that re-evaluation. It draws on the past, both real and imagined, to depict a liberated version of the future.