There's a ball placed in the cartridge which detects the movements of the GBA. While moving the GBA, you can change gravitation so Yoshi can walk on the walls or on the roof.