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