Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void createNewTopWallBlocks() {
- createNewBlock(0, 0, true);
- createNewBlock(0, 1, false);
- createNewBlock(7, 0, true);
- createNewBlock(7, 1, false);
- }
- void createNewBlock(int x, int y, bool border) {
- if (border)
- blocks[x][y] = 5;
- else
- blocks[x][y] = 6;
- }
- void scrollAllBlocks() {
- for (int y = 5; y >= 0; y--) {
- for (int x = 0; x < 8; x++) {
- blocks[x][y+1] = blocks[x][y];
- blocks[x][y+2]=blocks[x][y+1];
- }
- }
- }
- void renderBlocks() {
- for (int x = 0; x < 8; x++) {
- for (int y = 0; y < 8; y++) {
- switch (blocks[x][y]) {
- case 0:
- break;
- case 1:
- case 5:
- AberLED.set(0, y, RED);
- AberLED.set(7, y, RED);
- break;
- case 6:
- AberLED.set(0, y, BLACK);
- AberLED.set(7, y, BLACK);
- break;
- default: // anything else must be yellow
- AberLED.set(x, y, YELLOW);
- }
- }
- }
Add Comment
Please, Sign In to add comment