Return to repo list

gatemender

Arcade game about fixing warp gates. LibreJam Dec 2020 Entry.
Return to HMagellan.com

commit e743774876c8ce577b52c6a561ce0e1f00b9567b
parent ef7a61cf2b7417167531f3f21c7f72cff6f127f1
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Mon,  7 Dec 2020 16:41:56 -0600

Fixed transition screen

Diffstat:
Msrc/constants.py | 20+++++++++++---------
Msrc/game.py | 9+++++----
2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/src/constants.py b/src/constants.py @@ -1,5 +1,14 @@ import pygame, os, enum +# KEYS +TURN_LEFT_KEY = pygame.K_a +TURN_RIGHT_KEY = pygame.K_d +BRAKE_KEY = pygame.K_s +SHOOT_KEY = pygame.K_SPACE +THRUST_KEY = pygame.K_w +REPAIR_KEY = pygame.K_e +BURST_KEY = pygame.K_k + SCREEN_DIM = (1024, 768) FRAMERATE = 60 COLORKEY = (255, 0, 255) @@ -24,8 +33,8 @@ IMAGE_FILES = { "Beta_Halo_Angle" : os.path.join("data", "beta_halo_angle.png"), "Gamma_Halo_Straight" : os.path.join("data", "gamma_halo_straight.png"), "Gamma_Halo_Angle" : os.path.join("data", "gamma_halo_angle.png"), - "White_Halo_Straight" : os.path.join("data", "white_halo_straight.png"), - "White_Halo_Angle" : os.path.join("data", "white_halo_angle.png"), +# "White_Halo_Straight" : os.path.join("data", "white_halo_straight.png"), +# "White_Halo_Angle" : os.path.join("data", "white_halo_angle.png"), "Alpha_Icon" : os.path.join("data", "alpha_material.png"), "Beta_Icon" : os.path.join("data", "beta_material.png"), "Gamma_Icon" : os.path.join("data", "gamma_material.png"), @@ -51,12 +60,5 @@ SOUND_FILES = { #"Flash" : os.path.join("data", "") } FONTPATH = os.path.join("data", "computerspeak03.ttf") -TURN_LEFT_KEY = pygame.K_a -TURN_RIGHT_KEY = pygame.K_d -BRAKE_KEY = pygame.K_s -SHOOT_KEY = pygame.K_SPACE -THRUST_KEY = pygame.K_w -REPAIR_KEY = pygame.K_e -BURST_KEY = pygame.K_k MATERIALS = enum.Enum("MATERIALS", "Alpha Beta Gamma") MODES = enum.Enum("MODES", "Menu Transition GameOver Play") diff --git a/src/game.py b/src/game.py @@ -147,7 +147,7 @@ class Game(object): self.load_level() self.play_sound("Game_Music", 0) elif mode == MODES.Transition: - self.lives_text = self.font.render(str(self.lives), False, (255, 255, 255)) + self.lives_text = self.font.render(" X " + str(self.lives), False, (255, 255, 255)) self.level_text = self.font.render("GATE " + str(self.level_factor), False, (255, 255, 255)) self.transition_timer = self.transition_timer_max elif mode == MODES.GameOver: @@ -239,7 +239,7 @@ class Game(object): mousepos = pygame.mouse.get_pos() if not self.show_info: if self.start_button_rect.collidepoint(mousepos): - self.change_mode(MODES.Play) + self.change_mode(MODES.Transition) elif self.instructions_button_rect.collidepoint(mousepos): self.show_info = True self.just_pressed = True @@ -278,8 +278,9 @@ class Game(object): #self.screen.blit(self.options_button, self.options_button_rect) elif self.mode == MODES.Transition: self.screen.fill((0, 0, 0)) - self.screen.blit(self.lives_text, (100, 100)) - self.screen.blit(self.level_text, (100, 200)) + self.screen.blit(self.images["Ship"], (self.screen_rect.centerx - 30, 280)) + self.screen.blit(self.lives_text, (self.screen_rect.centerx + 30, 280)) + self.screen.blit(self.level_text, (self.screen_rect.centerx, 380)) elif self.mode == MODES.GameOver: self.screen.fill((0, 0, 0)) self.screen.blit(self.game_over_text, (100, 100))