1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
#include "Log.h"
void Log::drawLog(int lane)
{
p.setColor(white);
// reduce timer counter
timer--;
switch(lane)
{
case 1:
rowNum = 3;
// is timer 0?
if (timer==0) {
// yes its zero, time to update
p.plot(colNum, 3, SQUARE);
p.plot(colNum, 4, SQUARE);
p.setColor(darkblue);
p.plot(colNum - 10, 3, SQUARE);
p.plot(colNum - 10, 4, SQUARE);
p.setColor(white);
colNum++;
if (colNum == 85) colNum = 0;
timer = LOG_SPEED; // reset back timer
}
break;
case 2:
rowNum = 8;
if (timer == 0) {
p.plot(colNum, 8, SQUARE);
p.plot(colNum, 9, SQUARE);
Sleep(50);
p.setColor(darkblue);
p.plot(colNum - 10, 8, SQUARE);
p.plot(colNum - 10, 9, SQUARE);
p.setColor(white);
colNum++;
if (colNum == 85) colNum = 0;
timer = LOG_SPEED;
}
break;
case 3:
rowNum = 13;
if (timer == 0) {
p.plot(colNum, 13, SQUARE);
p.plot(colNum, 14, SQUARE);
Sleep(50);
p.setColor(darkblue);
p.plot(colNum-10, 13, SQUARE);
p.plot(colNum-10, 14, SQUARE);
p.setColor(white);
colNum++;
if (colNum == 85) colNum = 0;
timer = LOG_SPEED;
}
break;
case 4:
rowNum = 18;
if (timer == 0) {
p.plot(colNum, 18, SQUARE);
p.plot(colNum, 19, SQUARE);
Sleep(50);
p.setColor(darkblue);
p.plot(colNum-10, 18, SQUARE);
p.plot(colNum-10, 19, SQUARE);
p.setColor(white);
colNum++;
if (colNum == 85) colNum = 0;
timer = LOG_SPEED;
}
break;
case 5:
rowNum = 23;
if (timer == 0) {
p.plot(colNum, 23, SQUARE);
p.plot(colNum, 24, SQUARE);
Sleep(50);
p.setColor(darkblue);
p.plot(colNum-10, 23, SQUARE);
p.plot(colNum-10, 24, SQUARE);
p.setColor(white);
colNum++;
if (colNum == 85) colNum = 0;
timer = LOG_SPEED;
}
break;
}
}
|