Browse Source

cli changements

old
Kalyax 2 years ago
parent
commit
3f46c54d8d
  1. 0
      charaters/Inventaire.py
  2. 3
      charaters/personnage.py
  3. 27
      cli/cli.py
  4. 4
      main.py

0
Inventaire.py → charaters/Inventaire.py

3
Personnage.py → 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 =

27
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)
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)

4
main.py

@ -0,0 +1,4 @@
from personnage import *
if __name__ == "__main__":
personnage = Personnage()
Loading…
Cancel
Save