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