For a more robust implementation, see: https://github.com/marmitoTH/GoSonic2D
All sprites and audios are property of Sega, you can't use them for comercial purpose.
The scripts are made by me and are under the MIT No Attribution license, no credits needed, but very appreciated.