During the climax of the film, Anakin Skywalker is placed in the cockpit of a Naboo starfighter to protect him from the battle that is raging in the Naboo hangar. R2-D2 is in the droid socket of the fighter. Anakin quickly figures out the controls of the fighter and blasts some battle droids with the fighter's lasers. Then, Anakin launches the space craft and enters the space battle that is occuring in space above Naboo. With Anakin's piloting skills, the Naboo forces are able to route the Trade Federation's starships and the Naboo are victorious.
After winning the pod race, one of Anakin's friends accuses him of cheating. Anakin attacks his friend in a rage. Qui-Gon instructs Anakin in the proper way to conduct himself when using the Force.
In Episode I, Senator Palpatine plays the role of a good guy who helps Queen Amidala win over the Senate so that the Republic will help Naboo. Palpatine actually helps the good guys in their efforts to defeat the dark lords of the Sith.