Page 94 - MDP2022-3
P. 94
}
for (int y = 0; y < 4; y++) {
for (int x = 0; x < 4; x++) drawLine(color,x,0,3,x,3,y);
flushBuffer();
clearBuffer();
delay(animationSpeed);
}
side = 5; break;
case 13:
for (int y = 0; y < 4; y++) {
for (int z = 0; z < 4; z++) drawLine(color,z,0,0,z,y,3);
flushBuffer();
clearBuffer();
delay(animationSpeed);
}
for (int y = 3; y >0 -1; y--) {
for (int x = 0; x < 4; x++) drawLine(color,x,0,0,x,3,y);
flushBuffer();
clearBuffer();
delay(animationSpeed);
}
side = 6; break;
}
}
if (side == 4) {
switch(random(15,20)) {
case 15:
for (int y = 3; y > -1; y--){
for (int z = 0; z < 4; z++) drawLine(color,3,3,z,y,0,z);
flushBuffer();
clearBuffer();
delay(animationSpeed);
}
for (int x = 0; x < 4; x++) {
for (int z = 0; z < 4; z++) drawLine(color,3,3,z,0,x,z);
flushBuffer();
clearBuffer();
delay(animationSpeed);
}
side = 1; break;
case 16:
for (int y = 3; y > -1; y--) {
for (int z = 3; z > -1; z--) drawLine(color,3,0,z,y,3,z);
flushBuffer();
clearBuffer();