Tapping
#include <futurocube>
new motion
new i
new palette[] = [cBLUE, cRED, cORANGE, cMAGENTA, cPURPLE]
//note that palette is filled from index 1, index zero has color 0x00000000
main()
{
RegAllSideTaps()
RegMotion(TAP_DOUBLE)
SetIntensity(256)
SetDoubleTapLength(500)
PaletteFromArray(palette)
i = 1
SetColor(i)
for (;;)
{
motion = Motion()
if (motion)
{
Play("drip")
if (++i > sizeof(palette)) i = 1
SetColor(i)
if (_is(motion, TAP_DOUBLE))
{
DrawCube()
Vibrate(150)
}
DrawSide(eTapSide())
AckMotion()
}
PrintCanvas()
Sleep()
}
}Last updated