-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest3.py
75 lines (46 loc) · 1.19 KB
/
test3.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import pygame
import time
from random import*
from tkinter import*
blue = (113,177,227) #valeur max =255.
white = (255,255,255)
black = (0,0,0)
pygame.init()
surfaceW = 500
surfaceH = 500
pacW = 15
pacH = 15
surface = pygame.display.set_mode((surfaceW,surfaceH))
pygame.display.set_caption("Pacman")
clock = pygame.time.Clock()
img = pygame.image.load('pac.gif')
def rejoueOuQuitte():
for event in pygame.event.get([pygame.KEYDOWN, pygame.KEYUP, pygame.QUIT]):
if event.type == pygame.QUIT :
pygame.quit()
quit()
elif event.type ==pygame.KEYUP:
continue
return event.key
return None
def creaTexteObjs (texte, font):
texteSurface = font.render(texte,True,white)
return texteSurface, texteSurface.get_rect()
main()
def gameOver():
msgSurface("Boom!")
def pac(x,y, image):
surface.blit(image, (x,y))
def main():
x=250
y=250
y_move=0
score_actuel = 0
game_over = False
while not game_over:
surface.fill(black)
pac(x,y,img)
pygame.display.update()
main()
pygame.quit()
quit()