From 4ffac24c2b2dd6e2332e1fb12c314cbf0689bd50 Mon Sep 17 00:00:00 2001 From: Wobbl Date: Fri, 19 Jul 2024 11:41:56 +0200 Subject: [PATCH] Adjusted some settings and removed a debug print. --- sprite_stacking_engine/cache.py | 7 ++++--- sprite_stacking_engine/settings.py | 3 ++- sprite_stacking_engine/stacked_sprite.py | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sprite_stacking_engine/cache.py b/sprite_stacking_engine/cache.py index e8366d7..9cb2568 100644 --- a/sprite_stacking_engine/cache.py +++ b/sprite_stacking_engine/cache.py @@ -1,6 +1,7 @@ #!/usr/bin/python3 import os +from random import randrange from settings import * @@ -8,7 +9,7 @@ class Cache: def __init__(self): self.stacked_sprite_cache = {} self.viewing_angle = 360 // NUM_ANGLES - self.outline_thickness = 4 + self.outline_thickness = 2 self.get_stacked_sprite_cache() def get_stacked_sprite_cache(self): @@ -31,7 +32,7 @@ class Cache: self.run_animation_prerender(object_name, frames, attrs) def run_prerender(self, object_name, layer_array, attrs): - outline = attrs.get("outline", True) + outline = attrs.get("outline", OUTLINE) for angle in range(NUM_ANGLES): surface = pygame.Surface(layer_array[0].get_size()) @@ -57,7 +58,7 @@ class Cache: self.stacked_sprite_cache[object_name]["rotated_sprites"][angle] = image def run_animation_prerender(self, object_name, frames, attrs): - outline = attrs.get("outline", True) + outline = attrs.get("outline", OUTLINE) for angle in range(NUM_ANGLES): surface = pygame.Surface(list(frames.items())[0][1][0].get_size()) diff --git a/sprite_stacking_engine/settings.py b/sprite_stacking_engine/settings.py index b3655e7..a67b895 100644 --- a/sprite_stacking_engine/settings.py +++ b/sprite_stacking_engine/settings.py @@ -13,7 +13,8 @@ PLAYER_ROT_SPEED = 0.0015 BG_COLOR = "olivedrab" NUM_ANGLES = 180 # multiple of 360 -TRANSP_COLOR = (43, 64, 36) +TRANSP_COLOR = (45, 54, 76) +OUTLINE = True SPRITE_ATTRS = { "Robot": { diff --git a/sprite_stacking_engine/stacked_sprite.py b/sprite_stacking_engine/stacked_sprite.py index 6cc3bd3..135a8d7 100644 --- a/sprite_stacking_engine/stacked_sprite.py +++ b/sprite_stacking_engine/stacked_sprite.py @@ -80,7 +80,6 @@ class AnimatedStackedSprite(pygame.sprite.Sprite): def animate(self): self.frame = str(round(self.app.time) * 4 % 3) - print(self.frame) self.rotated_sprites = self.cache[self.name]["frames"][self.frame]["rotated_sprites"] def get_image(self):