Polish animations

This commit is contained in:
Matyáš Caras 2022-01-25 17:30:09 +01:00
parent bd4d04e06f
commit 0b6d9b287c
2 changed files with 4 additions and 1 deletions

Binary file not shown.

View file

@ -4,6 +4,7 @@ from colorama import Fore, Back, Style
import re import re
from .ascii import ascii_art from .ascii import ascii_art
from time import sleep from time import sleep
from os import system
class Game: class Game:
def __init__(self,data:dict): def __init__(self,data:dict):
@ -29,7 +30,7 @@ class Game:
animated = re.search(r"(?!{).+(?=})",self.nodes[self.current]["text"]) # find the animated text animated = re.search(r"(?!{).+(?=})",self.nodes[self.current]["text"]) # find the animated text
if(animated != None): if(animated != None):
self.print_animated(animated.group(0)) self.print_animated(animated.group(0))
self.nodes[self.current]["text"] = self.nodes[self.current]["text"].replace(animated.group(0),"") # remove the animated text from the text prompt self.nodes[self.current]["text"] = self.nodes[self.current]["text"].replace("{"+animated.group(0)+"}","") # remove the animated text from the text prompt
print(self.parse_colors(self.nodes[self.current]["text"])) print(self.parse_colors(self.nodes[self.current]["text"]))
print("") print("")
ostring = "" ostring = ""
@ -52,8 +53,10 @@ class Game:
''' '''
animation = ascii_art(animid) animation = ascii_art(animid)
for frame in animation: for frame in animation:
system("cls||clear")
print(frame) print(frame)
sleep(0.2) sleep(0.2)
print()
def parse_colors(self,text:str) -> str: def parse_colors(self,text:str) -> str: