Introduction
The example demonstrates how to create a dance sequence with Quadruped with Music.
Code for Stage Mode
- When Quarky‘s left pushbutton is pressed, it will wait for 1 second and play a sound.
- After that, Quadruped will wave its right hand and move back to the “home“ position. Then
- Quarky will play different tones and Quadruped will do different actions.
- Finally, Quadruped will move back to the “home“ position.
sprite = Sprite('Tobi')
quarky = Quarky()
import time
quad=Quadruped(4,1,8,5,3,2,7,6)
quad.home()
while True
quarky.playsound("QuarkyIntro")
quad.action("right hand wave",700,2)
quad.home()
quarky.playtone("E5",8)
quad.action("front back",700,3)
quarky.playtone("C4",8)
quad.action("bodyshake2",700,3)
quarky.playtone("D4",8)
quad.action("bodyshake3",700,3)
quarky.playtone("E4",8)
quad.action("bodyshake4",700,3)
quarky.playtone("C5",8)
quad.action("updown1",700,3)
quad.home()
Code for Upload Mode
You can also make the Quadruped dance work independent of PictoBlox using the Upload Mode. For that switch to upload mode.
Output
Explore: Try to create your dance sequence.