Browse Source

cli changements

old
Kalyax 2 years ago
parent
commit
3f46c54d8d
  1. 0
      charaters/Inventaire.py
  2. 3
      charaters/personnage.py
  3. 21
      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 from random import randint
class StatsSet(): class StatsSet():
@ -11,7 +10,7 @@ class StatsSet():
self.critrateP = critrateP self.critrateP = critrateP
self.xpcoef = xpcoef self.xpcoef = xpcoef
class ClassType(Enum): class ClassType:
GUERRIER = StatsSet(20, 10, 12, 5, 10, 8) GUERRIER = StatsSet(20, 10, 12, 5, 10, 8)
MAGICIEN = StatsSet(16, 12, 6, 8, 15, 7) MAGICIEN = StatsSet(16, 12, 6, 8, 15, 7)
#VOLEUR = #VOLEUR =

21
cli/cli.py

@ -62,21 +62,22 @@ class CLI:
if (x, y) in self.screen: if (x, y) in self.screen:
content += self.screen[(x, y)] content += self.screen[(x, y)]
else: else:
content += "a" content += " "
content += "\n" content += "\n"
print("\033[H\033[J", end="") print("\033[H\033[J", end="")
print(content) print(content)
cli = CLI() if __name__ == "__main__":
layer = Layer(cli.x, cli.y) cli = CLI()
layer.put_char("t", 5, 6, Colors.BLUEBG, Colors.BLACK) layer = Layer(cli.x, cli.y)
layer.put_string("""test""", 8, 9, Colors.BEIGEBG) layer.put_char("t", 5, 6, Colors.BLUEBG, Colors.BLACK)
layer.put_string("""test""", 8, 9, Colors.BEIGEBG)
cli.set_layer("test", layer) cli.set_layer("test", layer)
##cli.put_char("t", 5, 6, Colors.BLUEBG, Colors.BLACK) ##cli.put_char("t", 5, 6, Colors.BLUEBG, Colors.BLACK)
#cli.put_string("tttaaaaaa ttt \n ttttttttttnnnnnn t", 8, 9, Colors.BEIGEBG) #cli.put_string("tttaaaaaa ttt \n ttttttttttnnnnnn t", 8, 9, Colors.BEIGEBG)
#cli.draw() #cli.draw()
while True: while True:
cli.draw() cli.draw()
sleep(1) sleep(1)

4
main.py

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