Here's a simple text-based game implemented using JavaScript in a single HTML file where Sonic must save his friends from Eggman and Infinite by going through past worlds. Since using pictograms directly in this text-based format is not possible, a playable sample game is provided instead.
In the provided game, Sonic starts his adventure in the first world - Green Hill Zone. Each time Sonic goes through a world, he saves a friend and progresses to the next world. After clearing all the past worlds, a message is displayed indicating that Sonic is ready for the final showdown with Eggman and Infinite.
To play the game, simply open the HTML file in a web browser or host it on a web server. The progress and gameplay actions are logged to the browser console.