-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.py
More file actions
executable file
·38 lines (27 loc) · 908 Bytes
/
Copy pathgame.py
File metadata and controls
executable file
·38 lines (27 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import pygame
import game_values
import game_board
import play_game
WINDOW = pygame.display.set_mode((game_values.WIDTH, game_values.HEIGHT))
pygame.display.set_caption("Checkers Game")
def get_pos_mous_event(position):
x,y = position
row = y//game_values.SQUARE_SIZE
column = x//game_values.SQUARE_SIZE
return row, column
def main():
play = 1
game = play_game.play_Game(WINDOW)
# Cheking basic piece movement
# piece = board.get_piece(2,0)
# board.move(piece, 4,4)
while play:
for event in pygame.event.get():
if event.type == pygame.QUIT:
play = 0 # end the game
if event.type == pygame.MOUSEBUTTONDOWN:
position = pygame.mouse.get_pos()
row, column = get_pos_mous_event(position)
game.update()
pygame.quit()
main()