-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (25 loc) · 725 Bytes
/
main.py
File metadata and controls
35 lines (25 loc) · 725 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
import pygame
from config import *
from game_logic import Game
from gui import GameGUI
def main():
pygame.init()
screen = pygame.display.set_mode((TABLE_WIDTH, TABLE_HEIGHT + 100))
pygame.display.set_caption("2-Player Pool Game")
game = Game()
gui = GameGUI(screen, game)
clock = pygame.time.Clock()
while game.running:
gui.handle_events()
# Update the game state
game.update()
# Clear the screen and draw everything
screen.fill(GREEN)
gui.render()
# Update the display
pygame.display.flip()
# Limit the frame rate
clock.tick(FPS)
pygame.quit()
if __name__ == "__main__":
main()