Return to repo list

gatemender

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

commit 0f97eade15642bf2dc5328a7f300ae500b17fb67
parent 491aa5468fe466fef45336763d3d83dcd5d2b530
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Mon, 14 Dec 2020 17:06:02 -0600

Improved colorkey implementation and fixed pink bg on transition lives icon

Diffstat:
Msrc/game.py | 2++
Msrc/sprites.py | 4----
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/game.py b/src/game.py @@ -20,6 +20,8 @@ class Game(object): # Loading self.images = { i : pygame.image.load(IMAGE_FILES[i]).convert() for i in IMAGE_FILES } + for i in self.images: + self.images[i].set_colorkey(COLORKEY) self.keys = { CONTROLS[k] : False for k in CONTROLS } self.sounds = { s : pygame.mixer.Sound(SOUND_FILES[s]) for s in SOUND_FILES } self.channels = [pygame.mixer.Channel(x) for x in range(0, pygame.mixer.get_num_channels() - 1)] diff --git a/src/sprites.py b/src/sprites.py @@ -10,7 +10,6 @@ class CustomSprite(pygame.sprite.Sprite): # Values self.manager = manager self.image = image - self.image.set_colorkey(COLORKEY) self.base_image = image self.rect = self.image.get_rect() self.rect.center = pos @@ -23,7 +22,6 @@ class CustomSprite(pygame.sprite.Sprite): def rotate(self, angle): self.angle = angle self.image = pygame.transform.rotate(self.base_image, angle).convert() - self.image.set_colorkey((255, 0, 255)) self.rect = self.image.get_rect(center = self.rect.center) def offset_move(self, offset): @@ -233,7 +231,6 @@ class GatePiece(CustomSprite): self.halo_rect = None if self.broken: self.halo_image = pygame.transform.rotate(self.manager.images[self.requirement.name + "_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.needed = random.randint(1, self.manager.level_factor) @@ -263,7 +260,6 @@ class GatePiece(CustomSprite): self.halo_rect = None self.image = self.manager.images["Gate_" + self.or_name + "_Fixed"] self.base_image = self.image - self.image.set_colorkey((255, 0, 255)) self.rotate(self.angle) def update(self, surface = None):