From 9df72ba69deb0a5b2ffec39377d289673d9b6092 Mon Sep 17 00:00:00 2001 From: frank Date: Fri, 16 Dec 2022 19:28:00 -0500 Subject: [PATCH] lazy redraw effect --- electric_sieve/ElectricSieve.py | 13 +-- resource/high-scores | 143 ++------------------------------ 2 files changed, 16 insertions(+), 140 deletions(-) diff --git a/electric_sieve/ElectricSieve.py b/electric_sieve/ElectricSieve.py index e84d899..6444f79 100644 --- a/electric_sieve/ElectricSieve.py +++ b/electric_sieve/ElectricSieve.py @@ -143,12 +143,13 @@ class ElectricSieve(Game): return rotated def update(self): + self.background.set_alpha(int((1 - self.acid.get_volume() * 1.75) * 255)) self.title.update() if self.triangles.active: self.display.screen.blit(self.background, (0, 0)) + self.static.update() self.triangles.update() self.sieve.update() - self.static.update() class Title(GameChild): @@ -159,7 +160,7 @@ class Title(GameChild): self.delegate = self.parent.delegate # bg_color = (255, 222, 173) # bg_color = (220, 220, 148) - bg_color = 180, 152, 111 + bg_color = 200, 168, 122 self.background = surface = Surface(self.display_surface.get_size()) tile = Surface((2, 2)) tile.fill(bg_color) @@ -685,8 +686,7 @@ class Static(Sprite): pixel_arrays = [] for tile in tiles: pixel_arrays.append(PixelArray(tile)) - colors = (0, 0, 0), (64, 64, 64), (128, 128, 128), (196, 196, 196), \ - (255, 255, 255) + colors = (0, 0, 0), (64, 64, 64), (128, 128, 128), (196, 196, 196), (255, 255, 255) for x in range(len(pixel_arrays[0])): for y in range(len(pixel_arrays[0][0])): for pixels in pixel_arrays: @@ -745,12 +745,13 @@ class Static(Sprite): self.end.play(-1, 0, 4000) self.total.load() elif not self.complete: - self.set_alpha(min(185, int(self.intensity * 1.4 * 255))) + self.set_alpha(min(150, int(self.intensity * 1.15 * 255))) if self.intensity > 0: self.intensity *= .998 self.increaser.update() self.noise.set_volume(self.intensity) - Sprite.update(self) + if self.intensity > .1: + Sprite.update(self) self.total.update() self.initials.update() diff --git a/resource/high-scores b/resource/high-scores index e08630a..e73c31e 100644 --- a/resource/high-scores +++ b/resource/high-scores @@ -1,134 +1,9 @@ -1398631170.296798 80 ELE -1398631170.296798 60 ELE -1398631170.296798 50 ELE -1398635621.7 40 ELE -1398635792.99 30 ELE -1398635792.99 25 ELE -1398635792.99 20 ELE -1398635792.99 15 ELE -1398635792.99 10 ELE -1477748068.61 243 WHY -1477748240.21 184 BAG -1477763761.58 5 --- -1477763942.16 0 --- -1477764025.2 40 YUK -1477764132.35 14 --- -1477764204.69 24 --- -1477764570.94 9 --- -1477764602.15 0 --- -1477764660.02 6 --- -1477764750.35 55 AGK -1477765340.32 190 RIP -1477768571.74 14 --- -1477768772.58 0 --- -1477769131.7 21 --- -1477769183.38 5 --- -1477769317.28 80 LIU -1477769587.16 34 --- -1477769656.89 0 --- -1477769708.04 14 --- -1477769770.34 20 --- -1477769818.04 10 --- -1477769948.28 52 ASS -1477770092.32 4 --- -1477770119.96 0 --- -1477770238.28 21 --- -1477770301.07 10 --- -1477770349.22 4 --- -1477770513.16 41 --- -1477770590.94 21 --- -1477770788.52 69 JWJ -1477770909.53 0 --- -1477770984.49 5 --- -1477771099.67 62 ADY -1477771232.1 69 MTF -1477771692.96 23 --- -1477771742.19 0 --- -1477771825.88 41 --- -1477771876.87 0 --- -1477771972.55 33 --- -1477772077.65 89 MAT -1477772182.63 52 --- -1477772479.69 0 --- -1477772571.16 53 --- -1477772613.57 9 --- -1477772674.38 32 --- -1477772783.02 0 --- -1477772842.52 17 --- -1477772889.79 4 --- -1477772948.6 10 --- -1477773133.47 6 --- -1477773254.46 19 --- -1477773421.71 15 --- -1477773476.89 5 --- -1477773558.69 45 --- -1477773648.28 41 --- -1477773945.17 38 --- -1477773980.75 0 --- -1477774066.36 34 --- -1477774173.2 0 --- -1477774393.27 0 --- -1477774426.16 0 --- -1477774645.99 4 --- -1477774751.02 3 --- -1477774863.05 82 -EZ -1477774946.95 66 --- -1477775012.79 60 --- -1477775186.44 58 --- -1477775325.88 5 --- -1477775398.29 11 --- -1477775455.41 3 --- -1477775504.09 4 --- -1477775570.27 0 --- -1477775631.52 4 --- -1477775678.09 5 --- -1477775727.62 3 --- -1477775794.63 8 --- -1477776006.54 26 --- -1477776055.58 3 --- -1477776114.26 10 --- -1477776190.09 11 --- -1477776657.47 0 --- -1477776807.8 32 --- -1477776870.36 0 --- -1477776972.51 45 --- -1477777483.3 0 --- -1477777513.8 0 --- -1477777590.3 18 --- -1477777701.37 37 --- -1477777814.43 62 --- -1477777941.07 124 AUD -1477779034.71 49 --- -1477779076.69 0 --- -1477779142.39 36 --- -1477779257.95 36 --- -1477779353.91 51 --- -1477779449.57 65 --- -1477779521.72 61 --- -1477779939.36 49 --- -1477780873.91 4 --- -1477781074.2 16 --- -1477781137.67 8 --- -1477960455.4 171 BAG -1477960525.41 4 --- -1477960616.95 69 --- -1477960692.55 71 --- -1477960881.08 170 COW -1522824850.43 6 --- -1522825023.01 199 HI- -1523576335.0 34 --- -1529983381.92 171 BUG -1586137469.11 247 NUT -1669926143.6577697 5 --- -1670815336.2178595 112 --- -1670815414.8010118 21 --- -1670815999.6434624 147 FLA -1670816044.5578532 24 --- -1670816145.6957958 124 --- -1670816263.0361412 223 GUN -1670816338.4996192 28 --- -1670816435.1543665 105 --- -1670816534.3354058 102 --- -1670816639.158178 146 --- -1670817307.1141152 53 --- -1670819531.720299 203 FLA +1398631170.296798 80 FIT +1398631170.296798 60 FIT +1398631170.296798 50 FIT +1398635621.7 40 FIT +1398635792.99 30 FIT +1398635792.99 25 FIT +1398635792.99 20 FIT +1398635792.99 15 FIT +1398635792.99 10 FIT