Code
sprite = Sprite('Tobi')
quarky = Quarky()
import time
quarky.setorientation(2)
quarky.setirthreshold("IRL", 3000)
quarky.setirthreshold("IRR", 3000)
while True:
if quarky.getirstate("IRL"):
if quarky.getirstate("IRR"):
quarky.cleardisplay()
else:
pass
quarky.runrobot("LEFT", 100)
time.sleep(0.3)
quarky.stoprobot()
else:
pass
if quarky.getirstate("IRR"):
quarky.runrobot("RIGHT", 100)
time.sleep(0.3)
quarky.stoprobot()
else:
pass
quarky.showemotion("happy")
quarky.playsounduntildone("QuarkyIntro")