From the Super Mario Wiki
Mario's Slides is one of Mario's minigames in Super Mario 64 DS and a variety Minigame in New Super Mario Bros. where the player must draw lines with the Stylus to guide Mario to the Power Star and away from the four Piranha Plants. Its gameplay is similar to another Super Mario 64 DS game, Connect the Characters.
Guide Mario down the slides to the Star. Draw lines on the Touch Screen to create new routes for him. If Mario lands in a Piranha Plant, it's game over! Collect five Stars to move up a stage.