diff --git a/NS.py b/NS.py index 9b8efe7..7313c14 100644 --- a/NS.py +++ b/NS.py @@ -746,6 +746,20 @@ class Platform(GameChild): elif edge == NS.W: return NS.E + def get_color_pair_from_edge(self, edge): + if edge == NS.N: + return self.lights[NS.LNW].color, self.lights[NS.LNE].color + elif edge == NS.NE: + return self.lights[NS.LNE].color, self.lights[NS.LSW].color + elif edge == NS.E: + return self.lights[NS.LNE].color, self.lights[NS.LSE].color + elif edge == NS.NW: + return self.lights[NS.LNW].color, self.lights[NS.LSE].color + elif edge == NS.S: + return self.lights[NS.LSW].color, self.lights[NS.LSE].color + elif edge == NS.W: + return self.lights[NS.LNW].color, self.lights[NS.LSW].color + def set_glowing(self, selected): for ii, light in enumerate(self.lights): light.glow_index = 0 @@ -1424,8 +1438,8 @@ class Sword(Animation): sprite.hide() def brandish(self): - position = self.parent.unbrandished.pop(0) sprite = self.sprites[self.next_index] + sprite.sword_position = position = self.parent.unbrandished.pop(0) self.next_index += 1 sprite.unhide() dsr = self.get_display_surface().get_rect() @@ -1468,8 +1482,33 @@ class Sword(Animation): def update(self): Animation.update(self) - for sprite in reversed(self.sprites): - sprite.update() + display_count = 0 + displayed_positions = [] + displayed_sprites = [] + for sprite in self.sprites: + if not sprite.is_hidden(): + if sprite.sword_position not in displayed_positions: + display_count += 1 + displayed_positions.append(sprite.sword_position) + displayed_sprites.append(sprite) + display_index = 0 + for sprite in reversed(displayed_sprites): + display_index += 1 + alpha = int(float(display_index) / display_count * 255) + frame = sprite.get_current_frame() + surface = frame.copy() + rect = surface.get_rect() + colors = self.get_game().platform.get_color_pair_from_edge(sprite.sword_position) + color_a = colors[0].r, colors[0].g, colors[0].b, alpha + color_b = colors[1].r, colors[1].g, colors[1].b, alpha + if sprite.sword_position == NS.N or sprite.sword_position == NS.S: + surface.fill(color_a, (0, 0, rect.w / 2, rect.h), BLEND_RGBA_MULT) + surface.fill(color_b, (rect.centerx, 0, rect.w / 2, rect.h), BLEND_RGBA_MULT) + else: + surface.fill(color_a, (0, 0, rect.w, rect.h / 2), BLEND_RGBA_MULT) + surface.fill(color_b, (0, rect.centery, rect.w, rect.h / 2), BLEND_RGBA_MULT) + self.get_display_surface().blit(surface, sprite.location.topleft) + # sprite.update() class Health(GameChild): diff --git a/lib/pgfw b/lib/pgfw index ff096ec..2077dab 160000 --- a/lib/pgfw +++ b/lib/pgfw @@ -1 +1 @@ -Subproject commit ff096eca52dc95a9eabfd9f25ba7c4e9415e4389 +Subproject commit 2077dabde65be3bbbc165bba8d349ca2d2f9a9c6 diff --git a/resource/Spoopy.png b/resource/Spoopy.png index 1cbd9dc..9c52204 100644 Binary files a/resource/Spoopy.png and b/resource/Spoopy.png differ diff --git a/resource/Sword.png b/resource/Sword.png index 8fe1cd3..a2af45a 100644 Binary files a/resource/Sword.png and b/resource/Sword.png differ diff --git a/resource/scores b/resource/scores index 33e4231..d3ede15 100644 --- a/resource/scores +++ b/resource/scores @@ -8,3 +8,8 @@ 5999999 5999999 5999999 +163063 +143896 +177012 +126061 +157603