From the Super Mario Wiki
Trampoline Terror is one of Mario's minigames in Super Mario 64 DS. This game is very similar to Trampoline Time, except Mario must earn points going across rainbow rings. Both minigames use Super Mario Sunshine's secret level music.
The game begins with a long line appearing at the bottom of the touch screen, turning into a large trampoline. If Mario bounces off it two times, the carpet will turn yellow, and then red. The third time that Mario bounces off it, the carpet disappears. The player can draw more trampolines using the Stylus, so Mario can bounce over them to get through the rings that appear on both screens. The larger the trampoline is, the higher Mario jumps.
If the player loses all of his three Lives, the minigame ends, showing the scores.
Only players with superb stylus skills will be able to make Mario bounce through the rings!