-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
51 lines (43 loc) · 1.52 KB
/
main.py
File metadata and controls
51 lines (43 loc) · 1.52 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
import pygame
from pygame.locals import *
from models.GameModels import *
from models.PieceModels import *
from models.PlayerModel import *
import sys
class Game():
"""docstring for ClassName"""
def __init__(self):
self.width = 300
self.height = 280
self.running = False
# Aqui onde mesa é inicializado já com o jogo montado ==> Check homolog/feature_debug branch
self.mesa = Mesa
def run(self):
pygame.init()
self.running = True
screen = pygame.display.set_mode((self.width, self.height ) )
# Fill background
background = pygame.Surface(screen.get_size())
background = background.convert()
background.fill((250, 250, 250))
# Display some text
font = pygame.font.Font(None, 36)
text = font.render("Rummikub", 1, (10, 10, 10))
textpos = text.get_rect()
textpos.centerx = background.get_rect().centerx
background.blit(text, textpos)
# Blit everything to the screen
screen.blit(background, (0, 0))
pygame.display.flip()
while (self.running):
for event in pygame.event.get():
if event.type == pygame.QUIT:
self.running = False
# Detecta mouse click
if event.type == pygame.MOUSEBUTTONDOWN:
print(event.button)
screen.blit(background, (0, 0))
pygame.display.flip()
if __name__ == "__main__":
game = Game()
game.run()