|
|
|
@ -472,6 +472,8 @@ class Tony(Sprite):
|
|
|
|
|
for sfx_name in self.get_audio().sfx:
|
|
|
|
|
if sfx_name.startswith("TonyTauntsBend_"):
|
|
|
|
|
self.taunts.append(sfx_name)
|
|
|
|
|
self.location.centerx = dsr.centerx
|
|
|
|
|
self.board.location.centerx = self.location.centerx
|
|
|
|
|
|
|
|
|
|
def set_frameset(self, name):
|
|
|
|
|
Sprite.set_frameset(self, name)
|
|
|
|
@ -495,8 +497,11 @@ class Tony(Sprite):
|
|
|
|
|
save = self.get_display_surface()
|
|
|
|
|
intermediate_surface = Surface(self.location.size, SRCALPHA)
|
|
|
|
|
self.display_surface = intermediate_surface
|
|
|
|
|
location_save = self.location.copy()
|
|
|
|
|
self.location.topleft = 0, 0
|
|
|
|
|
Sprite.update(self)
|
|
|
|
|
self.display_surface = save
|
|
|
|
|
self.location = location_save
|
|
|
|
|
self.effect.display_surface = intermediate_surface
|
|
|
|
|
self.effect.update(flags=BLEND_RGBA_SUB)
|
|
|
|
|
self.get_display_surface().blit(intermediate_surface, self.location.topleft)
|
|
|
|
@ -739,7 +744,7 @@ class Dialogue(Animation):
|
|
|
|
|
Animation.__init__(self, parent)
|
|
|
|
|
ds = self.get_display_surface()
|
|
|
|
|
dsr = ds.get_rect()
|
|
|
|
|
frame = Surface((640, 72))
|
|
|
|
|
frame = Surface((dsr.w, 72))
|
|
|
|
|
frame.fill(self.BORDER)
|
|
|
|
|
frame.fill(self.BACKGROUND, (1, 1, frame.get_width() - 2, frame.get_height() - 2))
|
|
|
|
|
self.text_box = Sprite(self)
|
|
|
|
@ -946,18 +951,29 @@ class AdvancePrompt(GameChild):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Wipe(Animation):
|
|
|
|
|
"""
|
|
|
|
|
This class creates a blinds screen wipe effect that can be given a callback function to be called exactly when the screen is
|
|
|
|
|
filled with the wipe graphic. This allows the game to transition between states behind the wipe graphic to create a curtain
|
|
|
|
|
effect.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
BLIND_COUNT = 4
|
|
|
|
|
SPEED = 6
|
|
|
|
|
TRANSPARENT_COLOR = 255, 0, 0
|
|
|
|
|
|
|
|
|
|
def __init__(self, parent):
|
|
|
|
|
"""
|
|
|
|
|
Initialize the wipe image and sound effect
|
|
|
|
|
|
|
|
|
|
@param parent PGFW game object that instantiated the wipe
|
|
|
|
|
"""
|
|
|
|
|
Animation.__init__(self, parent)
|
|
|
|
|
self.image = load(self.get_resource("Ink.png")).convert()
|
|
|
|
|
self.image.set_colorkey(self.TRANSPARENT_COLOR)
|
|
|
|
|
self.sound = self.get_audio().sfx["wipe"]
|
|
|
|
|
|
|
|
|
|
def reset(self):
|
|
|
|
|
"""
|
|
|
|
|
Deactivate and stop the animation
|
|
|
|
|
"""
|
|
|
|
|
self.deactivate()
|
|
|
|
|
self.halt()
|
|
|
|
|
|
|
|
|
@ -968,15 +984,24 @@ class Wipe(Animation):
|
|
|
|
|
self.active = True
|
|
|
|
|
|
|
|
|
|
def start(self, callback):
|
|
|
|
|
"""
|
|
|
|
|
Trigger the wipe animation to begin. The given callback function will be called when the screen is filled with the
|
|
|
|
|
wipe graphic.
|
|
|
|
|
|
|
|
|
|
@param callback function to be called when the wipe is covering the screen
|
|
|
|
|
"""
|
|
|
|
|
self.activate()
|
|
|
|
|
self.up = True
|
|
|
|
|
# self.get_game().suppress_input()
|
|
|
|
|
self.blind_height = self.get_display_surface().get_height() / self.BLIND_COUNT
|
|
|
|
|
self.callback = callback
|
|
|
|
|
self.play()
|
|
|
|
|
self.sound.play()
|
|
|
|
|
|
|
|
|
|
def build_frame(self):
|
|
|
|
|
"""
|
|
|
|
|
This grows and shrinks the height of the blinds that control how much of the wipe graphic is currently displayed. It
|
|
|
|
|
will be called automatically every frame as long as the wipe's update method is being called.
|
|
|
|
|
"""
|
|
|
|
|
if self.up:
|
|
|
|
|
self.blind_height -= self.SPEED
|
|
|
|
|
if self.blind_height <= 0:
|
|
|
|
@ -990,18 +1015,22 @@ class Wipe(Animation):
|
|
|
|
|
self.get_game().unsuppress_input()
|
|
|
|
|
|
|
|
|
|
def update(self):
|
|
|
|
|
"""
|
|
|
|
|
Use the blind height value and screen clipping to draw the screen wipe in the state indicated by the blind height. The
|
|
|
|
|
screen is clipped to rects based on the blind height, and only those rects will have the wipe graphic drawn. Other screen
|
|
|
|
|
areas will show what is being drawn behind the screen wipe.
|
|
|
|
|
"""
|
|
|
|
|
if self.active:
|
|
|
|
|
Animation.update(self)
|
|
|
|
|
ds = self.get_display_surface()
|
|
|
|
|
dsr = ds.get_rect()
|
|
|
|
|
frame = self.image.copy()
|
|
|
|
|
for y in range(0, dsr.h, dsr.h // self.BLIND_COUNT):
|
|
|
|
|
if self.up:
|
|
|
|
|
frame.fill(self.TRANSPARENT_COLOR, (0, y, dsr.w, self.blind_height))
|
|
|
|
|
ds.set_clip((0, y, dsr.w, dsr.h // self.BLIND_COUNT - self.blind_height))
|
|
|
|
|
else:
|
|
|
|
|
frame.fill(self.TRANSPARENT_COLOR,
|
|
|
|
|
(0, y + dsr.h / self.BLIND_COUNT - self.blind_height, dsr.w, self.blind_height))
|
|
|
|
|
ds.blit(frame, (0, 0))
|
|
|
|
|
ds.set_clip((0, y + self.blind_height, dsr.w, dsr.h // self.BLIND_COUNT - self.blind_height))
|
|
|
|
|
ds.blit(self.image, (0, 0))
|
|
|
|
|
ds.set_clip(None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Platform(GameChild):
|
|
|
|
|