This commit is contained in:
Frank DeMarco 2018-09-20 02:02:27 -04:00
parent 09eedd72ae
commit 41c647b1e9
2 changed files with 30 additions and 21 deletions

47
NS.py
View File

@ -1041,7 +1041,7 @@ class Chemtrails(Sprite):
if not boss.is_playing(boss.show_end_dialogue):
self.timer.reset()
boss.combo()
self.timer.update()
# self.timer.update()
self.life.update()
def attack(self):
@ -1062,7 +1062,6 @@ class Chemtrails(Sprite):
self.timer.reset()
if not boss.is_playing(boss.show_end_dialogue):
boss.combo()
# boss.damaged.unhide()
self.get_game().sfx["complete_pattern_3"].play()
else:
self.get_game().sfx["land_0"].play()
@ -1159,7 +1158,9 @@ class Timer(GameChild):
draw.pieslice((0, 0, self.SIZE - 1, self.SIZE - 1), 90, remaining * 180 + 90,
fill=(color.r, color.g, color.b, color.a))
draw.ellipse((self.SIZE / 4, self.SIZE / 4, self.SIZE / 4 * 3, self.SIZE / 4 * 3), (0, 0, 0, 0))
return fromstring(image.tobytes(), image.size, image.mode)
string = fromstring(image.tobytes(), image.size, image.mode)
image.close()
return string
class Life(GameChild):
@ -1226,7 +1227,7 @@ class Boss(Animation):
self.spoopy.set_frameset("normal")
def start_level(self, index):
self.level_index = index
self.level_index = 2
self.battle_finished = False
self.player_defeated = False
self.health.reset()
@ -1534,7 +1535,6 @@ class Boss(Animation):
def update(self):
if self.active:
self.backgrounds[self.level_index].update()
# self.get_display_surface().fill((0, 0, 0))
dialogue = self.get_game().dialogue
if dialogue.active:
if self.advance_prompt.check_first_press():
@ -1678,8 +1678,6 @@ class Health(GameChild):
def __init__(self, parent):
GameChild.__init__(self, parent)
# self.background = Sprite(self)
# self.background.load_from_path(self.get_resource("HUD_background.png"), True)
self.background = Sprite(self)
self.background.load_from_path(self.get_resource("HUD_boss_health_background.png"), True)
dsr = self.get_display_surface().get_rect()
@ -1710,20 +1708,12 @@ class Health(GameChild):
def update(self):
self.background.update()
# self.label.update()
if self.amount > 50:
shift = 0
elif self.amount > 25:
shift = -70
else:
shift = -120
# mask = Surface(self.bar.get_size(), SRCALPHA)
# mask.fill((128, 128, 128))
# mask.fill(color, (0, 0, int(mask.get_width() * (self.amount / 100.0)),
# mask.get_height()))
# surface = self.bar.copy()
# surface.blit(mask, (0, 0), None, BLEND_RGBA_MIN)
# self.get_display_surface().blit(surface, self.BAR_POSITION)
ratio = self.amount / 100.0
ds = self.get_display_surface()
ds.set_clip((self.foreground.location.left, self.foreground.location.top,
@ -1754,6 +1744,7 @@ class Ending(Animation):
self.halt()
self.text_index = 0
self.advance_prompt.reset()
self.angle = choice((pi / 4, 3 * pi / 4, 5 * pi / 4, 7 * pi / 4))
def deactivate(self):
self.active = False
@ -1763,13 +1754,10 @@ class Ending(Animation):
self.play(self.start, delay=3000, play_once=True)
font = Font(self.get_resource("rounded-mplus-1m-bold.ttf"), 64)
time = self.get_game().title.get_formatted_time(self.get_game().most_recent_time)
foreground = font.render(time, True, (255, 28, 28))
# background = font.render(time, True, (0, 220, 220))
foreground = font.render(time, False, (180, 150, 20))
dsr = self.get_display_surface().get_rect()
self.text = RainbowSprite(self, foreground, 120)
self.text = RainbowSprite(self, foreground, 180, 200)
self.text.location.midtop = dsr.centerx, 80
# self.shadow = RainbowSprite(self, background, 120)
# self.shadow.location.midtop = dsr.centerx + 2, 70
def start(self):
self.advance_prompt.cancel_first_press()
@ -1806,7 +1794,24 @@ class Ending(Animation):
self.advance_prompt.cancel_first_press()
self.get_display_surface().blit(self.tony, (0, 0))
self.slime_bag.update()
# self.shadow.update()
dsr = self.get_display_surface().get_rect()
if self.text.location.right > dsr.right or self.text.location.left < dsr.left:
self.angle = reflect_angle(self.angle, 0)
if self.text.location.right > dsr.right:
self.text.move(dsr.right - self.text.location.right)
else:
self.text.move(dsr.left - self.text.location.left)
if self.text.location.bottom > self.get_game().dialogue.avatar_box.location.top \
or self.text.location.top < dsr.top:
self.angle = reflect_angle(self.angle, pi)
if self.text.location.top < dsr.top:
self.text.move(dy=dsr.top - self.text.location.top)
else:
self.text.move(
dy=self.get_game().dialogue.avatar_box.location.top - \
self.text.location.bottom)
dx, dy = get_delta(self.angle, 5, False)
self.text.move(dx, dy)
self.text.update()
self.get_game().dialogue.update()
if not wipe.is_playing() and not self.is_playing(self.start):

View File

@ -15,3 +15,7 @@
171204
256769
312561
167744
91410
41874
32477