void drawMap(){ for(int y = 0; y < HEIGHT; y++){ if(y > 0)display.DrawRectangle(0,y*BLOCKPIXSIZE,WIDTH*BLOCKPIXSIZE,WIDTH*BLOCKPIXSIZE,0x222222); for(int x = 0; x < WIDTH; x++){ display.DrawRectangle(x*BLOCKPIXSIZE,y*BLOCKPIXSIZE,BLOCKPIXSIZE-2,BLOCKPIXSIZE-2,map[x][y]); if((map[x][y] & MASK) == CODE){ //clears working block off the map map[x][y] = 0; } } } }
void drawNextBlock(){ int nt = 0; if(randBlocksi >= BLOCKNUM*PRERAND){nt = postceedingBlock;} else{nt = randBlocks[randBlocksi];} for(int ox=0;ox<BLOCKSIZE;ox++){ for(int oy=0;oy<BLOCKSIZE;oy++){ if(blocks[nt][rotationBlock][oy][ox]){ display.DrawRectangle(((WIDTH)+ox)*BLOCKPIXSIZE,((HEIGHT/2-BLOCKSIZE*2)+oy)*BLOCKPIXSIZE,BLOCKPIXSIZE-2,BLOCKPIXSIZE-2,colormap[nt]); } } } }
void drawBorders(){ display.DrawRectangle(0,HEIGHT*BLOCKPIXSIZE,WIDTH*BLOCKPIXSIZE,BLOCKSIZE*BLOCKPIXSIZE,0x000000); }