Exemplo n.º 1
0
#     screen.blit(ship, (x-ship.get_width()/2, ship_top))

#     for event in pygame.event.get():
#         if event.type == pygame.QUIT:
#             sys.exit()
#         elif event.type == MOUSEBUTTONDOWN:
#             shoot_y = 500
#             shoot_x = x

#     if shoot_y > 0:
#         screen.blit(shot, (shoot_x, shoot_y))
#         shoot_y -= 10

#     pygame.display.update()

from board import Board
from piece import Piece
from movement import *
first = Piece.getLocation((105, 98))
# second = Piece.getLocation((105,98))
second = Piece.getLocation((550, 547))

# # print(first)
# # print(second)

# # print(Piece.piece)

print("\n\n\n\n")

print(rook(1, 1))
print(getIndexOfPosition('H2'))
Exemplo n.º 2
0
row = 1
column = 1
running = True

# Render Chess Board to Screen
screen.blit(bg, (0, 0))
pygame.display.update()

# initialize First player

while running:

    for event in pygame.event.get():
        if event.type == MOUSEBUTTONDOWN:
            loc = pygame.mouse.get_pos()
            location = Piece.getLocation(loc)
            # print(location)
            pygame.display.update()

            # pygame.draw.rect(screen, (123,123,123), rect)

            screen.blit(bg, (0, 0))

        if event.type == MOUSEBUTTONUP:
            pass
        if event.type == pygame.QUIT:
            running = False

    # Render all chess piece according to their position
    for piece in Board.pieces: