Using blit, you draw on the screen.ĭraw grid creates the 2d list that will be used to access all of the nodes later, and make grid creates the grid’s boundaries (the black horizontal and vertical lines that separate the tiles).Įvery time the tick occurs, the update display is used to update the screen. The draw function is used to draw the tile onto the screen (the black and white pattern), whereas the setup method is used to put any images onto the screen if there is a piece on the screen at that location. We need these separately because all of these nodes will be stored in an 8×8 2d list, so if we call it, we’ll need its row and col numbers, whereas if we’re drawing it on the screen, we’ll need its x,y pixel values (we could just do row*100, but that would risk us forgetting to add that one time in the entire code and having it break). Their row, column, x, and y co-ordinates are their properties. These node objects are the fundamental components of my software, and they are simply containers for chess pieces (which are emulated as chess board tiles in this case).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |