diff --git a/src/gamestates/credits.py b/src/gamestates/credits.py index e2c0d06..cd43e4d 100644 --- a/src/gamestates/credits.py +++ b/src/gamestates/credits.py @@ -4,30 +4,71 @@ import assets import gamestate CREDITS_MUSIC = "mus_credits" -CREDITS_LENGTH = 10 +SCROLL_START_TIME = 2 SCROLL_SPEED = 5 +CREDITS_LENGTH = ((37 * 13) + SCROLL_START_TIME) / SCROLL_SPEED +CREDITS_TEXT = """Gratulálok, sikerült kivinni a játékot! -cred_text = text.TextRenderer(128, 180, None, True) + + + + + + + +==Programozás== +Markó József Attila +ChatGPT +Gemini +Claude + +==Vizúális dizájn== +Markó József Attila +Kazuko Shibuya +(Kefka sprite) +Akihiko Miura & Kouichi Ooyama +(Mother 3 betűtípus) + +==Zene== +Yoko Shimomura +(The Demon King Odio) +Rick Astley; Toby Fox; KrazedDonut +(Rick Buster) +Nobuo Uematsu +(The decisive Battle) +The Living Tombstone; JimboV +(The World Revolving, but I Can't Fix You) +Cazok +(The Final Battle) +Stevie T & Tokyo Speirs +(Subliminal Tie) + +Vége! +""" + +cred_text = text.TextRenderer(128, 100, None, True) end_text = text.TextRenderer(128, 100, None, True) -end_visible = False +ended = False t = 0 def switch(game): assets.sounds[CREDITS_MUSIC].play() - cred_text.reset("Gratulálunk, sikerült kivinni a játékot!\n\n\n\n\n\n\n==Programozás==\nMarkó József Attila\n\n") + cred_text.reset(CREDITS_TEXT) cred_text.type_all() end_text.reset("Vége!") end_text.type_all() def update(game, dt): - global t, end_visible + global t, ended t += dt - cred_text.move(0, dt * SCROLL_SPEED) - if t >= CREDITS_LENGTH: - end_visible = True + if t >= SCROLL_START_TIME: + cred_text.move(0, dt * SCROLL_SPEED) + if t >= CREDITS_LENGTH and not ended: + ended = True + cred_text.backtrack(5) def draw(game): cred_text.render() - if end_visible: + if ended: end_text.render() diff --git a/src/gamestates/overworld.py b/src/gamestates/overworld.py index d7eb195..8c071e5 100644 --- a/src/gamestates/overworld.py +++ b/src/gamestates/overworld.py @@ -92,7 +92,7 @@ def start_battle(battle_id): def switch(game): if len(objects) == 1: gamestate.switch_gamestate(game, "credits") - + return global music_box in_battle_transition = False overworld.set_player_world_pos(game, balthasar.x, balthasar.y) diff --git a/src/text.py b/src/text.py index 401362e..a612c8c 100644 --- a/src/text.py +++ b/src/text.py @@ -83,6 +83,10 @@ class TextRenderer: for s in self.sprites: s[1] = s[1].move(x, y) + def backtrack(self, n): + if n > 0: + self.sprites = self.sprites[:-n] + # !!! ChatGPT !!! def render(self, discoloration=(255,255,255)): offsets = []