sword arm ghosts
95
NS.py
|
@ -37,7 +37,7 @@ from lib.pgfw.pgfw.Animation import Animation
|
||||||
from lib.pgfw.pgfw.extension import (
|
from lib.pgfw.pgfw.extension import (
|
||||||
get_step, get_step_relative, get_delta, reflect_angle,
|
get_step, get_step_relative, get_delta, reflect_angle,
|
||||||
render_box, get_hsla_color, get_hue_shifted_surface,
|
render_box, get_hsla_color, get_hue_shifted_surface,
|
||||||
get_color_swapped_surface, load_frames
|
get_color_swapped_surface, load_frames, fill_colorkey
|
||||||
)
|
)
|
||||||
from lib.pgfw.pgfw.gfx_extension import aa_filled_polygon
|
from lib.pgfw.pgfw.gfx_extension import aa_filled_polygon
|
||||||
|
|
||||||
|
@ -733,6 +733,11 @@ class Title(Animation):
|
||||||
|
|
||||||
|
|
||||||
class Dialogue(Animation):
|
class Dialogue(Animation):
|
||||||
|
"""
|
||||||
|
This class creates the graphics for displaying character dialog. It displays an avatar, a character name, and a box with the
|
||||||
|
dialog text in classic RPG format. It uses the Animation class to scroll the text onto the screen with a sound effect to mimic
|
||||||
|
talking.
|
||||||
|
"""
|
||||||
|
|
||||||
BACKGROUND = 255, 255, 255
|
BACKGROUND = 255, 255, 255
|
||||||
BORDER = 0, 0, 0
|
BORDER = 0, 0, 0
|
||||||
|
@ -840,8 +845,7 @@ class SkipPrompt(GameChild):
|
||||||
top = 3
|
top = 3
|
||||||
left = 3
|
left = 3
|
||||||
for ii, edge in enumerate((NS.S, NS.NE, NS.W)):
|
for ii, edge in enumerate((NS.S, NS.NE, NS.W)):
|
||||||
self.buttons.append(Button(self, edge, AdvancePrompt.BUTTON_SIZE,
|
self.buttons.append(Button(self, edge, AdvancePrompt.BUTTON_SIZE, AdvancePrompt.BUTTON_BORDER))
|
||||||
AdvancePrompt.BUTTON_BORDER))
|
|
||||||
self.buttons[-1].location.topleft = left, top
|
self.buttons[-1].location.topleft = left, top
|
||||||
if ii < 2:
|
if ii < 2:
|
||||||
self.pluses.append(Sprite(self))
|
self.pluses.append(Sprite(self))
|
||||||
|
@ -1366,15 +1370,12 @@ class Light(Animation):
|
||||||
boss = self.get_game().boss
|
boss = self.get_game().boss
|
||||||
chemtrails = self.get_game().chemtrails
|
chemtrails = self.get_game().chemtrails
|
||||||
# checks the boss attack queue and chameleon queue index to see if the glow should be started now
|
# checks the boss attack queue and chameleon queue index to see if the glow should be started now
|
||||||
if boss.queue and boss.brandish_complete and not self.is_playing(self.glow) \
|
if boss.queue and not self.is_playing(self.glow) \
|
||||||
and self.in_orientation(boss.queue[chemtrails.queue_index]):
|
and self.in_orientation(boss.queue[chemtrails.queue_index]):
|
||||||
self.play(self.glow)
|
self.play(self.glow)
|
||||||
# turns off the glow
|
# turns off the glow
|
||||||
elif self.is_playing(self.glow) and (not boss.queue or not self.in_orientation(boss.queue[chemtrails.queue_index])):
|
elif self.is_playing(self.glow) and (not boss.queue or not self.in_orientation(boss.queue[chemtrails.queue_index])):
|
||||||
self.reset()
|
self.reset()
|
||||||
# if not self.hidden:
|
|
||||||
# ds = self.get_display_surface()
|
|
||||||
# aa_filled_polygon(ds, self.get_points(), self.color)
|
|
||||||
|
|
||||||
def get_points(self):
|
def get_points(self):
|
||||||
if self.get_game().title.active:
|
if self.get_game().title.active:
|
||||||
|
@ -1561,7 +1562,7 @@ class Life(Meter):
|
||||||
dsr = self.get_display_surface().get_rect()
|
dsr = self.get_display_surface().get_rect()
|
||||||
background = load(self.get_resource("HUD_health.png")).convert()
|
background = load(self.get_resource("HUD_health.png")).convert()
|
||||||
rect = background.get_rect()
|
rect = background.get_rect()
|
||||||
rect.bottomleft = 172, dsr.bottom - 4
|
rect.bottomleft = 4, dsr.bottom - 4
|
||||||
self.setup(background, rect, 70, (255, 0, 0), 3, "scrapeIcons/scrapeIcons_03.png")
|
self.setup(background, rect, 70, (255, 0, 0), 3, "scrapeIcons/scrapeIcons_03.png")
|
||||||
|
|
||||||
def decrease(self):
|
def decrease(self):
|
||||||
|
@ -1609,7 +1610,7 @@ class Boss(Animation):
|
||||||
self.visitor = Sprite(self, 42)
|
self.visitor = Sprite(self, 42)
|
||||||
self.visitor.load_from_path("alienAnimations/alienBoil", True)
|
self.visitor.load_from_path("alienAnimations/alienBoil", True)
|
||||||
for sprite in self.kool_man, self.visitor, self.spoopy:
|
for sprite in self.kool_man, self.visitor, self.spoopy:
|
||||||
sprite.location.topleft = 100, 0
|
sprite.location.topleft = 207, 10
|
||||||
self.health = Health(self)
|
self.health = Health(self)
|
||||||
self.sword = Sword(self)
|
self.sword = Sword(self)
|
||||||
self.register(self.brandish, self.cancel_flash, self.show_introduction_dialogue,
|
self.register(self.brandish, self.cancel_flash, self.show_introduction_dialogue,
|
||||||
|
@ -1650,7 +1651,9 @@ class Boss(Animation):
|
||||||
}
|
}
|
||||||
orientation_frame_indices = {}
|
orientation_frame_indices = {}
|
||||||
for path, orientation in static_arm_frame_map.items():
|
for path, orientation in static_arm_frame_map.items():
|
||||||
self.alien_arm.load_from_path(list(root.glob(path))[0], True)
|
base = pygame.image.load(str(list(root.glob(path))[0]))
|
||||||
|
colorkeyed = fill_colorkey(base)
|
||||||
|
self.alien_arm.add_frame(colorkeyed)
|
||||||
frame_index = len(self.alien_arm.frames) - 1
|
frame_index = len(self.alien_arm.frames) - 1
|
||||||
self.alien_arm.add_frameset([frame_index], name=str(orientation))
|
self.alien_arm.add_frameset([frame_index], name=str(orientation))
|
||||||
orientation_frame_indices[orientation] = frame_index
|
orientation_frame_indices[orientation] = frame_index
|
||||||
|
@ -1724,13 +1727,13 @@ class Boss(Animation):
|
||||||
dialogue.activate()
|
dialogue.activate()
|
||||||
if self.level_index == 0:
|
if self.level_index == 0:
|
||||||
dialogue.show_text("You'll never be able to block my sword, you lizard slime!" +
|
dialogue.show_text("You'll never be able to block my sword, you lizard slime!" +
|
||||||
" See\nif you can keep up with these moves!")
|
" See if you can keep up\nwith these moves!")
|
||||||
elif self.level_index == 1:
|
elif self.level_index == 1:
|
||||||
dialogue.show_text("We're just warming up, slime breath! Prepare to get spun" +
|
dialogue.show_text("We're just warming up, slime breath! Prepare to get spun" +
|
||||||
" by\nthese combos!")
|
" by these combos!")
|
||||||
elif self.level_index == 2:
|
elif self.level_index == 2:
|
||||||
dialogue.show_text("Lizard! My moves are so unpredictable you might as well" +
|
dialogue.show_text("Lizard! My moves are so unpredictable you might as well" +
|
||||||
" give\nup now!")
|
" give up now!")
|
||||||
self.play(self.end_dialogue, delay=5000, play_once=True)
|
self.play(self.end_dialogue, delay=5000, play_once=True)
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
|
@ -1974,7 +1977,7 @@ class Boss(Animation):
|
||||||
dialogue.show_text("Just like I thought!")
|
dialogue.show_text("Just like I thought!")
|
||||||
else:
|
else:
|
||||||
dialogue.show_text("H-how? But you're only a lizard! How could you" +
|
dialogue.show_text("H-how? But you're only a lizard! How could you" +
|
||||||
" manage to defeat\nall of us?")
|
" manage to defeat all of us?")
|
||||||
if self.player_defeated:
|
if self.player_defeated:
|
||||||
self.countdown.activate()
|
self.countdown.activate()
|
||||||
else:
|
else:
|
||||||
|
@ -2036,7 +2039,18 @@ class Boss(Animation):
|
||||||
self.kool_man.update()
|
self.kool_man.update()
|
||||||
elif self.level_index == 1:
|
elif self.level_index == 1:
|
||||||
self.visitor.update()
|
self.visitor.update()
|
||||||
self.alien_arm.update()
|
if self.brandish_complete:
|
||||||
|
if self.queue is not None:
|
||||||
|
self.alien_arm.unhide()
|
||||||
|
remaining_positions = list(reversed(self.queue[self.get_game().chemtrails.queue_index:]))
|
||||||
|
for ii, position in enumerate(remaining_positions):
|
||||||
|
alpha = int((ii + 1) / len(remaining_positions) * 255)
|
||||||
|
self.alien_arm.set_frameset(str(position))
|
||||||
|
self.alien_arm.get_current_frame().set_alpha(alpha)
|
||||||
|
self.alien_arm.update()
|
||||||
|
self.alien_arm.get_current_frame().set_alpha(255)
|
||||||
|
else:
|
||||||
|
self.alien_arm.update()
|
||||||
elif self.level_index == 2:
|
elif self.level_index == 2:
|
||||||
self.spoopy.update()
|
self.spoopy.update()
|
||||||
self.sword.update()
|
self.sword.update()
|
||||||
|
@ -2113,12 +2127,13 @@ class Sword(Animation):
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
Animation.__init__(self, parent)
|
Animation.__init__(self, parent)
|
||||||
swords = self.swords = []
|
swords = self.swords = []
|
||||||
for root in "Sword_kool_man/", "Sword_visitor/", "Sword_spoopy/":
|
#for root in "Sword_kool_man/", "Sword_visitor/", "Sword_spoopy/":
|
||||||
|
for root in "Sword_kool_man/", "local/test/", "Sword_spoopy/":
|
||||||
swords.append([[], [], [], [], [], []])
|
swords.append([[], [], [], [], [], []])
|
||||||
base_image_paths = sorted(iglob(join(self.get_resource(root), "*.png")))
|
base_image_paths = sorted(iglob(join(self.get_resource(root), "*.png")))
|
||||||
if not self.get_configuration("display", "effects"):
|
if not self.get_configuration("display", "effects"):
|
||||||
base_image_paths = [base_image_paths[0]]
|
base_image_paths = [base_image_paths[0]]
|
||||||
for path in base_image_paths:
|
for frame_index, path in enumerate(base_image_paths):
|
||||||
base = load(self.get_resource(path)).convert_alpha()
|
base = load(self.get_resource(path)).convert_alpha()
|
||||||
for position in range(6):
|
for position in range(6):
|
||||||
if position == NS.N or position == NS.S:
|
if position == NS.N or position == NS.S:
|
||||||
|
@ -2133,6 +2148,11 @@ class Sword(Animation):
|
||||||
colors = self.get_game().platform.get_color_pair_from_edge(position)
|
colors = self.get_game().platform.get_color_pair_from_edge(position)
|
||||||
color_a = Color(colors[0].r, colors[0].g, colors[0].b, 255)
|
color_a = Color(colors[0].r, colors[0].g, colors[0].b, 255)
|
||||||
color_b = Color(colors[1].r, colors[1].g, colors[1].b, 255)
|
color_b = Color(colors[1].r, colors[1].g, colors[1].b, 255)
|
||||||
|
# edit lightness to create glowing effect
|
||||||
|
for color in (color_a, color_b):
|
||||||
|
h, s, l, a = color.hsla
|
||||||
|
l = 30 + int(abs((frame_index % 10) - 5) / 5 * 60)
|
||||||
|
color.hsla = h, s, l, a
|
||||||
rect = surface.get_rect()
|
rect = surface.get_rect()
|
||||||
if position == NS.N or position == NS.S:
|
if position == NS.N or position == NS.S:
|
||||||
surface.fill(color_a, (0, 0, rect.w / 2, rect.h), BLEND_RGBA_MIN)
|
surface.fill(color_a, (0, 0, rect.w / 2, rect.h), BLEND_RGBA_MIN)
|
||||||
|
@ -2168,7 +2188,7 @@ class Sword(Animation):
|
||||||
for frame in self.swords[level_index][position]:
|
for frame in self.swords[level_index][position]:
|
||||||
sprite.add_frame(frame)
|
sprite.add_frame(frame)
|
||||||
if position in (NS.W, NS.E):
|
if position in (NS.W, NS.E):
|
||||||
sprite.location.centery = dsr.centery - 100 + offset
|
sprite.location.centery = dsr.centery - 80 + offset
|
||||||
if position == NS.W:
|
if position == NS.W:
|
||||||
sprite.location.centerx = dsr.centerx - 100 - offset
|
sprite.location.centerx = dsr.centerx - 100 - offset
|
||||||
else:
|
else:
|
||||||
|
@ -2176,11 +2196,11 @@ class Sword(Animation):
|
||||||
elif position in (NS.N, NS.S):
|
elif position in (NS.N, NS.S):
|
||||||
sprite.location.centerx = dsr.centerx - offset
|
sprite.location.centerx = dsr.centerx - offset
|
||||||
if position == NS.N:
|
if position == NS.N:
|
||||||
sprite.location.centery = dsr.centery - 170 + offset
|
sprite.location.centery = dsr.centery - 150 + offset
|
||||||
else:
|
else:
|
||||||
sprite.location.centery = dsr.centery + offset
|
sprite.location.centery = dsr.centery + 20 + offset
|
||||||
else:
|
else:
|
||||||
sprite.location.center = dsr.centerx - offset, dsr.centery - 100
|
sprite.location.center = dsr.centerx - offset, dsr.centery - 80
|
||||||
self.sprites.append(sprite)
|
self.sprites.append(sprite)
|
||||||
self.get_audio().play_sfx("brandish")
|
self.get_audio().play_sfx("brandish")
|
||||||
self.play(self.lower, delay=400, play_once=True)
|
self.play(self.lower, delay=400, play_once=True)
|
||||||
|
@ -2208,16 +2228,9 @@ class Sword(Animation):
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
Animation.update(self)
|
Animation.update(self)
|
||||||
for ii, sprite in enumerate(reversed(self.sprites)):
|
# only draw the current sword in the queue
|
||||||
if ii == len(self.sprites) - 1:
|
if self.sprites:
|
||||||
substitute = None
|
self.sprites[0].update()
|
||||||
else:
|
|
||||||
mask = self.masks[int(float(ii + 1) / len(self.sprites) * len(self.masks))]
|
|
||||||
frame = sprite.get_current_frame()
|
|
||||||
copy = frame.copy()
|
|
||||||
copy.blit(mask, (0, 0), None, BLEND_RGBA_MIN)
|
|
||||||
substitute = copy
|
|
||||||
sprite.update(substitute=substitute)
|
|
||||||
|
|
||||||
|
|
||||||
class Health(Meter):
|
class Health(Meter):
|
||||||
|
@ -2260,8 +2273,8 @@ class Health(Meter):
|
||||||
|
|
||||||
class Ending(Animation):
|
class Ending(Animation):
|
||||||
|
|
||||||
TEXT = "Wow! You vanquished all the goons and skated like a pro, slime bag.\n" + \
|
TEXT = "Wow! You vanquished all the goons and skated like a pro, slime bag." + \
|
||||||
"You made your father proud today. I love you, child.",
|
" You made your\nfather proud today. I love you, child.",
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
Animation.__init__(self, parent)
|
Animation.__init__(self, parent)
|
||||||
|
@ -2304,8 +2317,6 @@ class Ending(Animation):
|
||||||
def start(self):
|
def start(self):
|
||||||
self.advance_prompt.cancel_first_press()
|
self.advance_prompt.cancel_first_press()
|
||||||
dialogue = self.get_game().dialogue
|
dialogue = self.get_game().dialogue
|
||||||
# dialogue.activate()
|
|
||||||
# dialogue.set_avatar(self.tony_avatar)
|
|
||||||
dialogue.set_name("Tony")
|
dialogue.set_name("Tony")
|
||||||
dialogue.show_text(self.TEXT[0])
|
dialogue.show_text(self.TEXT[0])
|
||||||
self.text_index = 0
|
self.text_index = 0
|
||||||
|
@ -2322,18 +2333,6 @@ class Ending(Animation):
|
||||||
Animation.update(self)
|
Animation.update(self)
|
||||||
dialogue = self.get_game().dialogue
|
dialogue = self.get_game().dialogue
|
||||||
wipe = self.get_game().wipe
|
wipe = self.get_game().wipe
|
||||||
# if not wipe.is_playing() and not self.is_playing(self.start) and not self.text_index == 2:
|
|
||||||
# if self.advance_prompt.check_first_press():
|
|
||||||
# self.advance_prompt.press_first()
|
|
||||||
# elif self.advance_prompt.check_second_press():
|
|
||||||
# if dialogue.is_playing():
|
|
||||||
# dialogue.show_all()
|
|
||||||
# else:
|
|
||||||
# if self.text_index < len(self.TEXT) - 1:
|
|
||||||
# pass
|
|
||||||
# else:
|
|
||||||
# self.start_wipe()
|
|
||||||
# self.advance_prompt.cancel_first_press()
|
|
||||||
self.get_game().logo.update()
|
self.get_game().logo.update()
|
||||||
self.get_game().tony.update()
|
self.get_game().tony.update()
|
||||||
self.slime_bag.update()
|
self.slime_bag.update()
|
||||||
|
@ -2357,5 +2356,3 @@ class Ending(Animation):
|
||||||
self.text.move(dx, dy)
|
self.text.move(dx, dy)
|
||||||
self.text.update()
|
self.text.update()
|
||||||
self.get_game().dialogue.update()
|
self.get_game().dialogue.update()
|
||||||
# if not wipe.is_playing() and not self.is_playing(self.start):
|
|
||||||
# self.advance_prompt.update()
|
|
||||||
|
|
2
config
|
@ -30,7 +30,7 @@ effects = yes
|
||||||
|
|
||||||
[system]
|
[system]
|
||||||
# will force set display->effects to off
|
# will force set display->effects to off
|
||||||
minimize-load-time = yes
|
minimize-load-time = no
|
||||||
|
|
||||||
[mouse]
|
[mouse]
|
||||||
visible = no
|
visible = no
|
||||||
|
|
Before Width: | Height: | Size: 952 B After Width: | Height: | Size: 978 B |
Before Width: | Height: | Size: 537 KiB After Width: | Height: | Size: 610 KiB |
Before Width: | Height: | Size: 409 KiB After Width: | Height: | Size: 402 KiB |
Before Width: | Height: | Size: 627 KiB After Width: | Height: | Size: 740 KiB |
|
@ -11,3 +11,4 @@
|
||||||
52586
|
52586
|
||||||
54614
|
54614
|
||||||
52434
|
52434
|
||||||
|
168209
|
||||||
|
|