Version FINAL
This commit is contained in:
parent
101699b4a6
commit
405c39d399
@ -500,18 +500,110 @@ class Game:
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
|
self.screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
|
||||||
pygame.display.set_caption("Highway Encounter - Isometric Edition")
|
pygame.display.set_caption("Highway Vector - Edición Isométrica")
|
||||||
self.clock = pygame.time.Clock()
|
self.clock = pygame.time.Clock()
|
||||||
self.font = pygame.font.SysFont("monospace", 18, bold=True)
|
self.font = pygame.font.SysFont("monospace", 14, bold=True)
|
||||||
self.big_font = pygame.font.SysFont("monospace", 32, bold=True)
|
self.big_font = pygame.font.SysFont("monospace", 28, bold=True)
|
||||||
|
self.title_font = pygame.font.SysFont("monospace", 34, bold=True)
|
||||||
self.sprite_mgr = SpriteManager()
|
self.sprite_mgr = SpriteManager()
|
||||||
|
|
||||||
self.lives = 4
|
self.lives = 4
|
||||||
self.score = 0
|
self.score = 0
|
||||||
self.won = False
|
self.won = False
|
||||||
|
self.in_opening = True
|
||||||
|
|
||||||
self.reset_level()
|
self.reset_level()
|
||||||
|
|
||||||
|
def show_opening_screen(self):
|
||||||
|
"""Muestra la pantalla explicativa inicial al ejecutar el juego."""
|
||||||
|
while self.in_opening:
|
||||||
|
self.clock.tick(FPS)
|
||||||
|
for event in pygame.event.get():
|
||||||
|
if event.type == pygame.QUIT:
|
||||||
|
pygame.quit()
|
||||||
|
sys.exit()
|
||||||
|
if event.type == pygame.KEYDOWN:
|
||||||
|
if event.key == pygame.K_RETURN:
|
||||||
|
self.in_opening = False
|
||||||
|
|
||||||
|
self.screen.fill((10, 10, 20))
|
||||||
|
|
||||||
|
# Título principal
|
||||||
|
title_surf = self.title_font.render(
|
||||||
|
"HIGHWAY VECTOR", True, COLOR_YELLOW
|
||||||
|
)
|
||||||
|
self.screen.blit(
|
||||||
|
title_surf,
|
||||||
|
(SCREEN_WIDTH // 2 - title_surf.get_width() // 2, 20),
|
||||||
|
)
|
||||||
|
|
||||||
|
# Lista de elementos a mostrar
|
||||||
|
items = [
|
||||||
|
(
|
||||||
|
"player",
|
||||||
|
"Jugador: Flechas / WASD para mover, ESPACIO para disparar.",
|
||||||
|
),
|
||||||
|
("vortex", "Vortex: Objetivo llevar hasta la Zona 0."),
|
||||||
|
(
|
||||||
|
"block_white",
|
||||||
|
"Bloque Blanco: Se rompe con disparo y se puede empujar.",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"block_purple",
|
||||||
|
"Bloque Morado: No se rompe, solo se empuja con disparos.",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"enemy_red",
|
||||||
|
"Enemigo Rojo: Se mueve de lado a lado. Matable y bloqueable.",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"enemy_indestructible",
|
||||||
|
"Enemigo Blanco: Se mueve de lado a lado. Solo bloqueable.",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"enemy_diagonal",
|
||||||
|
"Enemigo Azul: Se mueve rebotando en diagonal. Solo bloqueable.",
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
|
start_y = 80
|
||||||
|
spacing_y = 65
|
||||||
|
|
||||||
|
for idx, (sprite_key, desc_text) in enumerate(items):
|
||||||
|
y_pos = start_y + idx * spacing_y
|
||||||
|
|
||||||
|
# Dibujar imagen del elemento
|
||||||
|
sprite = self.sprite_mgr.get_sprite(sprite_key)
|
||||||
|
img_x = 60 - sprite.get_width() // 2
|
||||||
|
img_y = y_pos + 12 - sprite.get_height() // 2
|
||||||
|
self.screen.blit(sprite, (img_x, img_y))
|
||||||
|
|
||||||
|
# Dibujar texto descriptivo
|
||||||
|
text_surf = self.font.render(desc_text, True, (230, 230, 230))
|
||||||
|
self.screen.blit(text_surf, (110, y_pos + 4))
|
||||||
|
|
||||||
|
# Línea divisoria discreta entre filas
|
||||||
|
if idx < len(items) - 1:
|
||||||
|
pygame.draw.line(
|
||||||
|
self.screen,
|
||||||
|
(30, 30, 50),
|
||||||
|
(40, y_pos + spacing_y - 8),
|
||||||
|
(SCREEN_WIDTH - 40, y_pos + spacing_y - 8),
|
||||||
|
)
|
||||||
|
|
||||||
|
# Mensaje para comenzar con efecto de parpadeo suave
|
||||||
|
blink = (pygame.time.get_ticks() // 400) % 2 == 0
|
||||||
|
start_color = (0, 255, 200) if blink else (0, 150, 120)
|
||||||
|
start_surf = self.big_font.render(
|
||||||
|
"Pulse INTRO para comenzar", True, start_color
|
||||||
|
)
|
||||||
|
self.screen.blit(
|
||||||
|
start_surf,
|
||||||
|
(SCREEN_WIDTH // 2 - start_surf.get_width() // 2, 545),
|
||||||
|
)
|
||||||
|
|
||||||
|
pygame.display.flip()
|
||||||
|
|
||||||
def reset_level(self):
|
def reset_level(self):
|
||||||
self.vortex = Vortex(3.5, GRID_SIZE_Y - 5)
|
self.vortex = Vortex(3.5, GRID_SIZE_Y - 5)
|
||||||
self.player = Player(3.5, GRID_SIZE_Y - 8)
|
self.player = Player(3.5, GRID_SIZE_Y - 8)
|
||||||
@ -579,6 +671,9 @@ class Game:
|
|||||||
self.screen.blit(text_surface, (20, 10))
|
self.screen.blit(text_surface, (20, 10))
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
if self.in_opening:
|
||||||
|
self.show_opening_screen()
|
||||||
|
|
||||||
running = True
|
running = True
|
||||||
while running:
|
while running:
|
||||||
self.clock.tick(FPS)
|
self.clock.tick(FPS)
|
||||||
@ -621,7 +716,7 @@ class Game:
|
|||||||
if self.lives <= 0:
|
if self.lives <= 0:
|
||||||
self.screen.fill((0, 0, 0))
|
self.screen.fill((0, 0, 0))
|
||||||
msg = self.font.render(
|
msg = self.font.render(
|
||||||
"GAME OVER - Press R to Restart", True, (255, 50, 50)
|
"GAME OVER - Pulsa R para Reiniciar", True, (255, 50, 50)
|
||||||
)
|
)
|
||||||
self.screen.blit(
|
self.screen.blit(
|
||||||
msg, (SCREEN_WIDTH // 2 - 150, SCREEN_HEIGHT // 2)
|
msg, (SCREEN_WIDTH // 2 - 150, SCREEN_HEIGHT // 2)
|
||||||
|
|||||||
BIN
img-versiones/version_final_01.png
Normal file
BIN
img-versiones/version_final_01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
BIN
img-versiones/version_final_02.png
Normal file
BIN
img-versiones/version_final_02.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
img-versiones/version_final_03.png
Normal file
BIN
img-versiones/version_final_03.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Loading…
x
Reference in New Issue
Block a user