Dimenticare icon

Chess board draw event

Dimenticare | PRO | 06/23/15 07:42:59 PM UTC | 0 ⭐ | 10713 👁️ | Never ⏰ | []
Game Maker |

0 B

|

None

|

0 👍

/

0 👎

// 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);
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎