Return to repo list

gatemender

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

commit 30906dd81e251ad0173314afffb7b1d666013fe6
parent 16fca828239d760b110ce183e673536e9efa67bb
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Sun,  6 Dec 2020 22:50:13 -0600

highlight asteroids and fix halos

Diffstat:
Mdata/asteroid_big.png | 0
Mdata/asteroid_medium.png | 0
Mdata/asteroid_small.png | 0
Msrc/sprites.py | 16+++++++++-------
4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/data/asteroid_big.png b/data/asteroid_big.png Binary files differ. diff --git a/data/asteroid_medium.png b/data/asteroid_medium.png Binary files differ. diff --git a/data/asteroid_small.png b/data/asteroid_small.png Binary files differ. diff --git a/src/sprites.py b/src/sprites.py @@ -122,16 +122,18 @@ class GatePiece(CustomSprite): self.broken = broken self.requirement = req self.needed = 0 - if self.broken: + self.halo_image = None + self.halo_rect = None + if not self.broken: self.halo_image = pygame.transform.rotate(self.manager.images[self.requirement + "_Halo_" + or_name], self.angle) - else: - self.halo_image = pygame.transform.rotate(self.manager.images["White_Halo_" + or_name], self.angle) - self.halo_image.set_colorkey(COLORKEY) - self.halo_rect = self.halo_image.get_rect() - self.halo_rect.center = self.rect.center + self.halo_image.set_colorkey(COLORKEY) + self.halo_rect = self.halo_image.get_rect() + self.halo_rect.center = self.rect.center + #self.halo_image = pygame.transform.rotate(self.manager.images["White_Halo_" + or_name], self.angle) def update(self, surface = None): - surface.blit(self.halo_image, self.halo_rect) + if self.halo_image != None: + surface.blit(self.halo_image, self.halo_rect) super().update(surface) # Asteroids