Return to repo list

heart-of-gold

Tactical RPG written in python, using pygame.
Return to HMagellan.com

commit d2188deb7890a246879e3b04267679748c1131e9
parent cd693066a707280a314cc94301be56247708a6c3
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Tue, 29 Dec 2020 16:00:04 -0600

battle intro logic

Diffstat:
Msrc/turn.py | 17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/turn.py b/src/turn.py @@ -34,7 +34,15 @@ class TurnManager(manager.Manager): self.in_play_pieces = [] self.turn_depth = 10 self.board_events = {} + + # Interval graphics and values self.intro_timer = 0 + self.intro_left_decal = None + self.intro_left_decal_topleft = (0, 0) + self.intro_right_decal = None + self.intro_right_decal_topleft = (0, 0) + self.intro_text = None + self.intro_text_rect = None # Turn tray and other associated entities self.turn_tray = None @@ -72,6 +80,10 @@ class TurnManager(manager.Manager): self.action_buttons.append(nab) self.shift_turns() self.intro_timer = 300 + self.intro_left_decal = sheets["battle_intro_decal_1"].sprites[(0, 0)] + self.intro_left_decal_topleft = (-1920, 460) + self.intro_right_decal = sheets["battle_intro_decal_1"].sprites[(0, 1)] + self.intro_right_decal_topleft = (1920, 490) if self.board_events["start_dialog"] != None: self.play_battle_dialog(self.board_events["start_dialog"]) @@ -205,6 +217,9 @@ class TurnManager(manager.Manager): """ if self.intro_timer > 0: self.intro_timer -= 1 + if self.intro_timer > 100: + self.left_intro_decal_topleft = (self.left_intro_decal_topleft[0] + 7, self.left_intro_decal_topleft[1]) + self.right_intro_decal_topleft = (self.right_intro_decal_topleft[0] - 7, self.right_intro_decal_topleft[1]) else: self.game.control_mode = CTRL_MODES.Turn_Normal @@ -312,6 +327,8 @@ class TurnManager(manager.Manager): self.stat_screen.update(surface) elif self.game.control_mode == CTRL_MODES.Battle_Intro: self.play_battle_intro() + surface.blit(self.left_intro_decal, self.left_intro_decal_topleft) + surface.blit(self.right_intro_decal, self.right_intro_decal_topleft) ############################# # Section 2 - Turn Entities #