-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAffichage.py
57 lines (41 loc) · 1.32 KB
/
Affichage.py
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
52
53
54
55
56
57
import pygame
import Jeu
import Snake
class Affichage:
def __init__(self):
self.__fenetre = pygame.display.set_mode((450, 450))
pygame.display.set_caption('Snake')
self.__resolution_x = 640
self.__resolution_y = 480
self.__corps_snake = pygame.image.load("case snake.png")
print('Affichage cree')
self.__serpent = Snake.Snake()
self.__jeu = Jeu.Jeu()
def affichage_jeu(self):
# affiche le background
self.affichage_tableau()
self.affichage_snake()
self.affichage_pomme()
self.affichage_score()
def affichage_tableau(self):
# print('tableau affiche')
return 0
def affichage_snake(self):
for coord in self.__serpent.get_liste_snake():
self.__fenetre.blit(self.__corps_snake, (coord[0]*30, coord[1]*30))
def affichage_pomme(self):
return 0
def affichage_score(self):
return 0
def effacer_fenetre(self):
self.__fenetre.fill((0, 0, 0))
def get_xres(self):
return self.__resolution_x
def get_yres(self):
return self.__resolution_y
def set_xres(self, valeur):
self.__resolution_x = valeur
def set_yres(self, valeur):
self.__resolution_y = valeur
def get_serpent(self):
return self.__serpent