added blocks
This commit is contained in:
parent
e76901b567
commit
0405287481
4 changed files with 11 additions and 3 deletions
12
main.c
12
main.c
|
|
@ -55,7 +55,7 @@ int main() {
|
|||
//struct ballStruct ball;
|
||||
time_t UNIXTIME = time(NULL);
|
||||
srand(UNIXTIME); //seed random number with time at run time
|
||||
int noXBlocks = SCREEN_WIDTH /2;
|
||||
int noXBlocks = SCREEN_WIDTH;
|
||||
Block_t blockArr[noXBlocks][Y_BLOCK_LAYERS];
|
||||
for (int x=0;x< noXBlocks;x++) {
|
||||
for (int y=0; y<Y_BLOCK_LAYERS; y++){
|
||||
|
|
@ -73,7 +73,13 @@ int main() {
|
|||
clearScreen();
|
||||
|
||||
//draw blocks
|
||||
|
||||
for (int x = 0;x<noXBlocks;x++){
|
||||
for (int y =0;y<Y_BLOCK_LAYERS;y++){
|
||||
if(blockArr[x][y].visable==true){
|
||||
screen[x][y]=PIXEL_BLOCK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//draw paddel
|
||||
screen[paddle.location][PADDLE_HEIGHT]=PIXEL_PADDLE;
|
||||
|
|
@ -98,6 +104,8 @@ int main() {
|
|||
printf("<>");
|
||||
} else if(screen[x][y]==PIXEL_PADDLE) {
|
||||
printf("==");
|
||||
} else if(screen[x][y]==PIXEL_BLOCK){
|
||||
printf("[]");
|
||||
}
|
||||
}
|
||||
printf("|\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue