For one month out of every year, a tiny planet appears in the skies above Never Lake. The mysterious "Little Planet" holds seven gems that control the passage of time, bending the barriers between past and future. Intrigued by the unusual power of these stones, Dr. Robotnik descends upon Little Planet and hatches a new scheme to take it over.
Fortunately, Sonic the Hedgehog has caught wind of Robotnik's plot and resolves to beat him to the Time Stones at all costs. However, to complicate matters Dr. Robotnik has kidnapped the young lady hedgehog Amy Rose, and uses her to bait Sonic and keep him off his trail. To that end, he deploys his most sophisticated and diabolical machine to date, a robot duplicate of the hedgehog hero, designed to match Sonic's every move and even match his own trademark speed.
The main innovation of this chapter in the Sonic series is the manner in which the player can travel to four different versions of each zone, each a different time period of the same location: Present, Past, Good Future and Bad Future. This is accomplished by speed posts scattered around the level, bearing the labels "Past", and "Future". After running through one of these posts, the player has to run at top speed for a few seconds without stopping, to travel into the respective time period.
The only way you could see the good ending is by collecting all 7 time stones and destroying Eggman's machine from the past.
http://www.youtube.com/watch?v=XrG6wcbqJio