-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
47 lines (33 loc) · 1.12 KB
/
main.py
File metadata and controls
47 lines (33 loc) · 1.12 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
import pygame
import sys
class runner():
pass
class Game():
corredores= []
def __init__(self):
self.__screen= pygame.display.set_mode((640,480))
pygame.display.set_caption("carrera de bichos")
self.background = pygame.image.load("images/background.png")
self.runner =pygame.image.load("imagenes/octopus.png")
def competir(self):
x=0
hayGanador=False
while True:
#comprobacion de los eventos
for event in pygame.event.get():
if event.type== pygame.QUIT:
pygame.quit()
sys.exit()
#refrescar pantalla
self.__screen.blit(self.background, (0,0))
self.__screen.blit (self.runner, (x,240))
pygame.display.flip()
x +=3
if x >= 250:
hayGanador =True
pygame.quit()
sys.exit()
if __name__== "__main__":
pygame.init()
game= Game()
game.competir()