Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // void drawBoard();
- // Loops through the Board array, drawing the squares as needed.
- // You could use a sprite to represent the chess board, but this is a little more memory effecient.
- var i, j;
- for (i=0; i<8; i+=1){
- for (j=0; j<8; j+=1){
- if ((i mod 2 ==0&&j mod 2==0)||(i mod 2 ==1&&j mod 2==1))
- draw_set_color(c_white);
- else
- draw_set_color(c_red);
- draw_rectangle(64+global.size*i, 32+global.size*j, 64+global.size*(i+1), 32+global.size*(j+1), false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment