King Candy, voiced by Alan Tudyk, in <i>Wreck-It Ralph</i>.

King Candy, voiced by Alan Tudyk, in the critically acclaimed animated film Wreck-It Ralph.

Some stories that you hear about the dubious ethics of Hollywood appear to be true. Alan Tudyk was up for the plum part of voicing King Candy in the Disney animated film Wreck-It Ralph. The filmmakers asked his agent if he could imitate the voice of old-time comedian and actor Ed Wynn.

Tudyk says, ''My agent said, 'Definitely', and then he called me and said, 'Can you do it, by the way?'''

Fortunately, it turned out that he could. The character, as envisaged, would resemble, physically and vocally, the Mad Hatter voiced by Wynn in Disney's 1951 animated feature Alice in Wonderland.

Alan Tudyk

Actor Alan Tudyk.

''I don't know whose original idea that was - maybe [director and co-writer] Rich Moore's,'' Tudyk says.

But he had a lot of fun bringing Wynn's distinctive lisping, gurgling voice to life, especially in a role in which a character who seems whimsical and playful turns out to have a very nasty side indeed.

''He [Wynn] never really got to do a bad guy like that,'' Tudyk says.

Comedian Ed Wynn

Comedian Ed Wynn.

To present-day audiences, Wynn is probably best known for playing jolly, floating Uncle Albert in Mary Poppins (1964), one of several Disney movies he appeared in during the latter part of his career.

Tudyk has appeared, physically and/or vocally, in many movies and TV shows, including Firefly, Serenity, Death at a Funeral and Dollhouse.

The title character in Wreck-It Ralph is a video-game antagonist (voiced by John C. Reilly) who yearns to be a well-loved hero like his adversary, Fix-It Felix Jr (Jack McBrayer). It drives him to group therapy for villains, but he eventually decides to do something about it. During his quest, he finds himself in the game Sugar Rush, ruled by King Candy, and risks destabilising the worlds of both games in the arcade.

Tudyk was one of the last actors to be cast - he remembers going up for a reading with the cast and all the main actors were there except Reilly, who hadn't yet been signed. He says he enjoyed the long sessions recording his dialogue with Reilly, as well as working with Moore. At first they did it according to the script, but once the initial tracks were laid down, they had the freedom to improvise in character.

''That's the fun part, seeing where your imagination can go.''

The script changed over time - what were supposed to be two characters voiced by Tudyk were merged into one. And - spoiler alert! - King Candy does not survive the film so the character won't be back if there is a sequel.

''I've heard rumours,'' Tudyk says, of the possibility of a follow-up film.

''If I was in it, I'd have to be a different character. If they asked me to do it, I wouldn't say no.''

It isn't the first time he's played a central character who's died. Fans of Joss Whedon's TV series Firefly will remember that the well-liked character Wash, played by Tudyk, was killed in the film spin-off, Serenity.

''Joss is known as a creator who kills characters - he's done it before,'' Tudyk says. And there's a reason for it: by killing characters off when the audience's guard is down, it increases the sense of danger and unpredictability. Everyone is vulnerable.

Tudyk has kept busy since Wreck-It Ralph came out to both critical acclaim and box-office success. He was in the movie 42, recently released in the US, about pioneering African-American baseball player Jackie Robinson, and not long ago he finished shooting the TV series Suburgatory.

He has several other projects coming up, including more animated movies.

''None that I can talk about just yet - but yes, definitely,'' he says.

We haven't seen - or heard - the last of Alan Tudyk.

Wreck-It Ralph was released on DVD and Blu-ray on April 24.