In the Space Pirate Mothership, you find Mecha-Ridley, a giant robot in the shape of your old foe.
Defeat Mecha-Ridley
Stay at the leftmost side of the screen at all times.
When Mecha-Ridley's head is raised, shoot the red light in Mecha-Ridley's chest to deal damage. At first, the red light is covered in glass, so keep shooting the glass to get rid of it, then hit the red light.
Mecha-Ridley will try to slam its hand down onto you. Jump upward to avoid this attack. Mecha-Ridley will shoot fireballs from its mouth. Space Jump between the two sets of fireballs to avoid them. If its eyes flash, it is about to shoot lasers out of its eyes. Jump as needed to avoid them. It will open a hatch on its back to send homing missiles to hit you. You can use Screw Attack to destroy the missiles and get health and weapon refills. As the battle goes on, Mecha-Ridley's attacks will become more frequent.
After Mecha-Ridley explodes, take the health and weapon refills that it drops. Its eye will flash, then a 5 minute self-destruct timer will begin, and you need to escape the mothership.