From 3f46c54d8dd9f39be914ef0e86b4f2ff05c50bb2 Mon Sep 17 00:00:00 2001 From: Kalyax Date: Mon, 12 Sep 2022 06:36:58 +0200 Subject: [PATCH] cli changements --- Inventaire.py => charaters/Inventaire.py | 0 Personnage.py => charaters/personnage.py | 3 +-- cli/cli.py | 27 ++++++++++++------------ main.py | 4 ++++ 4 files changed, 19 insertions(+), 15 deletions(-) rename Inventaire.py => charaters/Inventaire.py (100%) rename Personnage.py => charaters/personnage.py (97%) diff --git a/Inventaire.py b/charaters/Inventaire.py similarity index 100% rename from Inventaire.py rename to charaters/Inventaire.py diff --git a/Personnage.py b/charaters/personnage.py similarity index 97% rename from Personnage.py rename to charaters/personnage.py index e97c985..bccde6d 100644 --- a/Personnage.py +++ b/charaters/personnage.py @@ -1,4 +1,3 @@ -from enum import Enum from random import randint class StatsSet(): @@ -11,7 +10,7 @@ class StatsSet(): self.critrateP = critrateP self.xpcoef = xpcoef -class ClassType(Enum): +class ClassType: GUERRIER = StatsSet(20, 10, 12, 5, 10, 8) MAGICIEN = StatsSet(16, 12, 6, 8, 15, 7) #VOLEUR = diff --git a/cli/cli.py b/cli/cli.py index 474786b..fad9763 100644 --- a/cli/cli.py +++ b/cli/cli.py @@ -62,21 +62,22 @@ class CLI: if (x, y) in self.screen: content += self.screen[(x, y)] else: - content += "a" + content += " " content += "\n" print("\033[H\033[J", end="") print(content) -cli = CLI() -layer = Layer(cli.x, cli.y) -layer.put_char("t", 5, 6, Colors.BLUEBG, Colors.BLACK) -layer.put_string("""test""", 8, 9, Colors.BEIGEBG) - -cli.set_layer("test", layer) -##cli.put_char("t", 5, 6, Colors.BLUEBG, Colors.BLACK) -#cli.put_string("tttaaaaaa ttt \n ttttttttttnnnnnn t", 8, 9, Colors.BEIGEBG) -#cli.draw() +if __name__ == "__main__": + cli = CLI() + layer = Layer(cli.x, cli.y) + layer.put_char("t", 5, 6, Colors.BLUEBG, Colors.BLACK) + layer.put_string("""test""", 8, 9, Colors.BEIGEBG) -while True: - cli.draw() - sleep(1) \ No newline at end of file + cli.set_layer("test", layer) + ##cli.put_char("t", 5, 6, Colors.BLUEBG, Colors.BLACK) + #cli.put_string("tttaaaaaa ttt \n ttttttttttnnnnnn t", 8, 9, Colors.BEIGEBG) + #cli.draw() + + while True: + cli.draw() + sleep(1) \ No newline at end of file diff --git a/main.py b/main.py index e69de29..4c9198a 100644 --- a/main.py +++ b/main.py @@ -0,0 +1,4 @@ +from personnage import * + +if __name__ == "__main__": + personnage = Personnage() \ No newline at end of file