Sonic the Hedgehog is a 2D , side @-@ scrolling platformer , whose gameplay centers around Sonic 's ability to run at high speed through levels incorporating springs , slopes , high falls , and loop @-@ the @-@ loops . The levels contain hazards in the form of robots ( " badniks " in the Western game manuals ) inside of which Dr. Robotnik has trapped animals . Although destroying a robot frees the animal within , this is not required to complete the game . The player must avoid rows of sharp spikes , falling into bottomless pits , being crushed by moving walls or platforms , and drowning ( which can be avoided by breathing air bubbles periodically released from vents ) . Sonic 's main attack is his spin , where he curls into a ball and rotates rapidly ( damaging enemies and some obstacles ) . This can be performed by jumping in the air or rolling on the ground .