Adjusted some settings and removed a debug print.

This commit is contained in:
The Wobbler 2024-07-19 11:41:56 +02:00
parent 738e2ad519
commit 4ffac24c2b
3 changed files with 6 additions and 5 deletions

View file

@ -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())

View file

@ -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": {

View file

@ -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):