-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.py
77 lines (60 loc) · 2.4 KB
/
menu.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
76
77
import pygame
from settings import *
import time
from decoracion import *
import keyboard
pygame.init()
########### $$$$CONSTANTES$$$$ ###########
#Colores
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (85, 255, 51)
RED = (228, 22, 59 )
BLUE = (24, 26, 82 )
#Ventana
pantalla = pygame.display.set_mode((PANTALLA_ANCHO,PANTALLA_ALTO))
cielo = pygame.image.load('./images/background/fondoUnicoInicio.png').convert()
cielo = pygame.transform.scale(cielo, (PANTALLA_ANCHO, PANTALLA_ALTO))
cieloInstrucciones = pygame.image.load('./images/background/fondoUnicoInstrucciones.png').convert()
cieloInstrucciones = pygame.transform.scale(cieloInstrucciones, (PANTALLA_ANCHO, PANTALLA_ALTO))
#Fuente
font = pygame.font.SysFont("Source Serif Pro Black", 50)
############### MENU INICIO ###############################
def mensaje_en_pantalla(msg, color, txt_x, txt_y):
txt_pantalla = font.render(msg, True, color)
pantalla.blit(txt_pantalla, (txt_x, txt_y))
def menu():
#cielo.draw(self.display_superficie,self.desplazamiento_mundo)
pantalla.blit(cielo,(0, 0))
""" mensaje_en_pantalla("JAMPING", RED, 150, 110)
mensaje_en_pantalla("1. Jugar", WHITE, 180, 200)
mensaje_en_pantalla("2. Instrucciones", WHITE, 180, 250)
mensaje_en_pantalla("3. Salir", WHITE, 180, 300) """
pygame.display.update()
def instrucciones():
pantalla.blit(cieloInstrucciones,(0, 0))
""" mensaje_en_pantalla("Use las flachas izquierda y ", WHITE, 20, 220)
mensaje_en_pantalla("derecha o A y D para moverse, ", WHITE, 20, 270)
mensaje_en_pantalla("para saltar use la tecla SPACE", WHITE, 20, 320)
mensaje_en_pantalla("", WHITE, 20, 370)
mensaje_en_pantalla("", WHITE, 20, 420) """
pygame.display.update()
time.sleep(1)
##################################################
############################################################
'''
fin_bucle = False
while not fin_bucle:
menu()
for event in pygame.event.get():
if event.type == pygame.QUIT:
fin_bucle = True
if event.type == pygame.KEYUP:
if event.key == pygame.K_1:
print("hola mundo")
if event.key == pygame.K_2:
instrucciones()
if event.key == pygame.K_3:
pygame.display.quit()
fin_bucle = True
pygame.display.quit() '''