The King And The Crown is one implemntation of the Pellet Quest System. The game is actually only a graphic demo.
Browse code source here.