Skip to content
Snippets Groups Projects
Commit 0fc6801e authored by Aidan Mariglia's avatar Aidan Mariglia
Browse files

mapped board square to screen pos

parent 303ac291
No related branches found
No related tags found
No related merge requests found
import pygame, sys
import pygame, sys, squareMap
from pygame.locals import *
def drawboard():
......@@ -29,5 +29,5 @@ def drawboard():
screen.blit(bk, bkrect)
pygame.display.flip()
print(squareMap.squareMap)
drawboard()
import chess, pygame
class piece(chess.Piece):
"""
``P``, ``N``, ``B``, ``R``, ``Q`` or ``K`` for white
pieces or the lower-case variants for the black pieces.
"""
images = {
'P' : 'white_pawn.png',
'N' : 'white_knight.png',
'B' : 'white_bishop.png',
'R' : 'white_rook.png',
'Q' : 'white_queen.png',
'K' : 'white_king.png',
'p' : 'black_pawn.png',
'n' : 'black_knight.png',
'b' : 'black_bishop.png',
'r' : 'black_rook.png',
'q' : 'black_queen.png',
'k' : 'black_king.png',
}
def __init__(self, piece_type, color):
super(piece_type, color)
import chess
squareMap = {
chess.A1: [0,0],
chess.B1: [100,0],
chess.C1: [200,0],
chess.D1: [300,0],
chess.E1: [400,0],
chess.F1: [500,0],
chess.G1: [600,0],
chess.H1: [700,0],
chess.A2: [0,100],
chess.B2: [100,100],
chess.C2: [200,100],
chess.D2: [300,100],
chess.E2: [400,100],
chess.F2: [500,100],
chess.G2: [600,100],
chess.H2: [700,100],
chess.A3: [0,200],
chess.B3: [100,200],
chess.C3: [200,200],
chess.D3: [300,200],
chess.E3: [400,200],
chess.F3: [500,200],
chess.G3: [600,200],
chess.H3: [700,200],
chess.A4: [0,300],
chess.B4: [100,300],
chess.C4: [200,300],
chess.D4: [300,300],
chess.E4: [400,300],
chess.F4: [500,300],
chess.G4: [600,300],
chess.H4: [700,300],
chess.A5: [0,400],
chess.B5: [100,400],
chess.C5: [200,400],
chess.D5: [300,400],
chess.E5: [400,400],
chess.F5: [500,400],
chess.G5: [600,400],
chess.H5: [700,400],
chess.A6: [0,500],
chess.B6: [100,500],
chess.C6: [200,500],
chess.D6: [300,500],
chess.E6: [400,500],
chess.F6: [500,500],
chess.G6: [600,500],
chess.H6: [700,500],
chess.A7: [0,600],
chess.B7: [100,600],
chess.C7: [200,600],
chess.D7: [300,600],
chess.E7: [400,600],
chess.F7: [500,600],
chess.G7: [600,600],
chess.H7: [700,600],
chess.A8: [0,700],
chess.B8: [100,700],
chess.C8: [200,700],
chess.D8: [300,700],
chess.E8: [400,700],
chess.F8: [500,700],
chess.G8: [600,700],
chess.H8: [700,700],
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment