You start on a platform with a thinned out bridge in front of you, paint it and walk across. Over on the pagodas wall there should be a gear, do a spin move on it to get it going. By doing that, two platforms will come out of the pagoda, so now you can get to the top. Now walk around to the back and you'll see a way to get all the way to the top. Gremlin Braun should be sitting at the top. Break him free and as a reward, he'll start up all the boats so you can travel to all the islands.
Now you should jump on the boat in between the pagoda and the magic carpet ride. Jump on the second island. Now look for where the central shaft is on the ride and spin move the gear. This should make a wooden panel drop and there sits Gremlin Sam. Break him free, and he'll start the ride for you.
Use the gear to get up onto the wooden second floor. If you face towards the Pagoda, soon enough you should see a transparent object in front of you, paint it and it will reviel a magic carpet. Now jump on the magic carpet, this will lead you to the exit. But don't leave yet, go back over to the pagoda.