Browse Source

note

sql_version
manu D 2 years ago
parent
commit
2fb45b89cc
  1. BIN
      bdd.db
  2. BIN
      getkey/__pycache__/__init__.cpython-38.pyc
  3. BIN
      getkey/__pycache__/keynames.cpython-38.pyc
  4. BIN
      getkey/__pycache__/platforms.cpython-38.pyc
  5. BIN
      getkey/__pycache__/unikeys.cpython-38.pyc
  6. 42
      main.py

BIN
bdd.db

Binary file not shown.

BIN
getkey/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
getkey/__pycache__/keynames.cpython-38.pyc

Binary file not shown.

BIN
getkey/__pycache__/platforms.cpython-38.pyc

Binary file not shown.

BIN
getkey/__pycache__/unikeys.cpython-38.pyc

Binary file not shown.

42
main.py

@ -1,3 +1,9 @@
"""
C'est joli, mais il y aurait moyen de factoriser pas mal de choses!
Note : 10 / 10
"""
import random import random
import cli import cli
import time import time
@ -117,7 +123,7 @@ class Personnage(Animation):
self.coef_defense = data[3] self.coef_defense = data[3]
self.class_name = data[5].split('\n') self.class_name = data[5].split('\n')
self.shape = [data[7].replace('%', '\n'), data[8].replace('%', '\n')] self.shape = [data[7].replace('%', '\n'), data[8].replace('%', '\n')]
self.potion = 2 self.potion = 2
self.x = x self.x = x
self.y = y self.y = y
@ -195,10 +201,10 @@ class App:
\\ / \\ /
`.___.' """.split('\n') `.___.' """.split('\n')
self.opponent = [Personnage("Guerrier", 80, 45, "guerrier", 1, True), Personnage("Voleur", 80, 45, "voleur", 1, True), Personnage("Magicien", 80, 45, "magicien", 1, True), Personnage("Elfe", 80, 45, "elfe", 1, True)] self.opponent = [Personnage("Guerrier", 80, 45, "guerrier", 1, True), Personnage("Voleur", 80, 45, "voleur", 1, True), Personnage("Magicien", 80, 45, "magicien", 1, True), Personnage("Elfe", 80, 45, "elfe", 1, True)]
self.title = """ ██ ███████ ██ ██ ██████ ███████ ██████ ██████ ██ ███████ self.title = """ ██ ███████ ██ ██ ██████ ███████ ██████ ██████ ██ ███████
""".split('\n') """.split('\n')
def draw_arena(self, ennemi, choice): def draw_arena(self, ennemi, choice):
@ -207,14 +213,14 @@ class App:
self.character.display('right', color='BLUE') self.character.display('right', color='BLUE')
self.opponent[ennemi].display('left', color='GREEN') self.opponent[ennemi].display('left', color='GREEN')
gui.draw_bar(self.character.pdv * 100 // self.character.max_pdv, 5, 25, 30, color='RED') gui.draw_bar(self.character.pdv * 100 // self.character.max_pdv, 5, 25, 30, color='RED')
gui.draw_bar(self.character.xp * 100 // 20, 5, 27, 30, color='GREEN') gui.draw_bar(self.character.xp * 100 // 20, 5, 27, 30, color='GREEN')
gui.draw(self.character.nom, 15, 2, weight='BOLD') gui.draw(self.character.nom, 15, 2, weight='BOLD')
gui.draw(str(self.character.pdv), 38, 25, color='RED') gui.draw(str(self.character.pdv), 38, 25, color='RED')
gui.draw(str(self.character.xp), 38, 27, color='GREEN') gui.draw(str(self.character.xp), 38, 27, color='GREEN')
gui.draw_bar(self.opponent[ennemi].pdv * 100 // self.opponent[ennemi].max_pdv, 75, 25, 30, color='RED') gui.draw_bar(self.opponent[ennemi].pdv * 100 // self.opponent[ennemi].max_pdv, 75, 25, 30, color='RED')
gui.draw_bar(self.opponent[ennemi].xp * 100 // 20, 75, 27, 30, color='GREEN') gui.draw_bar(self.opponent[ennemi].xp * 100 // 20, 75, 27, 30, color='GREEN')
gui.draw(self.opponent[ennemi].nom, 90, 2) gui.draw(self.opponent[ennemi].nom, 90, 2)
@ -339,7 +345,7 @@ class App:
if choice == 1: if choice == 1:
# affichage de l'inventaire # affichage de l'inventaire
position = [0, 0] position = [0, 0]
while True: while True:
self.show_inventory(position) self.show_inventory(position)
key = getkey.getkey() key = getkey.getkey()
@ -380,13 +386,13 @@ class App:
c.close() c.close()
game_over = """ game_over = """
""".split('\n') """.split('\n')
for i in range(len(game_over)): for i in range(len(game_over)):
gui.draw(game_over[i], 60 - len(game_over[i])//2, 12+i, color='RED') gui.draw(game_over[i], 60 - len(game_over[i])//2, 12+i, color='RED')
@ -399,7 +405,7 @@ class App:
characters = [Personnage(name, 0, 5, "guerrier", 1, True), Personnage(name, 0, 5, "voleur", 1, True), Personnage(name, 0, 5, "magicien", 1, True), Personnage(name, 0, 5, "elfe", 1, True)] characters = [Personnage(name, 0, 5, "guerrier", 1, True), Personnage(name, 0, 5, "voleur", 1, True), Personnage(name, 0, 5, "magicien", 1, True), Personnage(name, 0, 5, "elfe", 1, True)]
for char in characters: for char in characters:
char.x = 60 - len(char.shape[0].split('\n')[0])//2 char.x = 60 - len(char.shape[0].split('\n')[0])//2
for i in range(len(characters[number_char].class_name)): for i in range(len(characters[number_char].class_name)):
gui.draw(characters[number_char].class_name[i], 60-(len(characters[number_char].class_name[0])//2), 25+i, color='RED', weight='BOLD') gui.draw(characters[number_char].class_name[i], 60-(len(characters[number_char].class_name[0])//2), 25+i, color='RED', weight='BOLD')
for i in range(2): for i in range(2):
gui.draw('/', 4-i, 17+i) gui.draw('/', 4-i, 17+i)
@ -410,7 +416,7 @@ class App:
gui.draw('Utilisez les flèche pour changer de personnage puis appuyez sur entrée', 30, 1) gui.draw('Utilisez les flèche pour changer de personnage puis appuyez sur entrée', 30, 1)
gui.display() gui.display()
while True: while True:
key = getkey.getkey() key = getkey.getkey()
if key == getkey.keys.RIGHT: if key == getkey.keys.RIGHT:
@ -425,7 +431,7 @@ class App:
del characters del characters
self.play() self.play()
break break
def menu(self): def menu(self):
"""permet de choisir son nom""" """permet de choisir son nom"""
for i in range(len(self.title)): for i in range(len(self.title)):

Loading…
Cancel
Save