The answer is Spaceballs, a 1987 American science fiction comedy film directed by Mel Brooks. It stars Rick Moranis as Dark Helmet, the main antagonist of the film. The film is a parody of the Star Wars franchise and other science fiction films of the time.
Unraveling Rick Moranis: A Journey Through Canadian Comedy