vbetsch / rpg Goto Github PK
View Code? Open in Web Editor NEW🎮 A Console Role Play Game in buildings
🎮 A Console Role Play Game in buildings
If the user dont have any character, trying to call the menu to delete a character will cause the program to crash.
See the play log:
[Figmou]
-----------MENU-----------
- Modifier votre compte (m)
- Supprimer votre compte (s)
- Jouer (j)
- Se déconnecter (d)
- Quitter (q)
j
[Figmou]
Veuillez choisir un personnage pour jouer
===========PERSONNAGES===========
- Choisir un personnage (c)
- Ajouter un personnage (a)
- Voir un personnage (v)
- Donner un personnage (d)
- Modifier un personnage (m)
- Supprimer un personnage (s)
- Liste des personnages (p)
- Voir les roles (r)
- Jouer (j)
- Quitter (q)
s
Quel est le nom du personnage que vous voulez supprimer ? dsjkl
Traceback
Traceback (most recent call last):
File ".../rpg/main.py", line 452, in <module>
if menu(make_choice()) is False:
File ".../rpg/main.py", line 437, in menu
return {
File ".../rpg/main.py", line 393, in char
if fiche_char(active_player, char_to_delete):
File ".../rpg/main.py", line 223, in fiche_char
if character.sexe == 'H':
AttributeError: 'NoneType' object has no attribute 'sexe'
This come from char_to_delete
being None
The same occurs when trying tryng to modify a character
[Non connecté]
Veuillez choisir un personnage pour jouer
===========PERSONNAGES===========
- Choisir un personnage (c)
- Ajouter un personnage (a)
- Voir un personnage (v)
- Donner un personnage (d)
- Modifier un personnage (m)
- Supprimer un personnage (s)
- Liste des personnages (p)
- Voir les roles (r)
- Jouer (j)
- Quitter (q)
m
Quel est le nom du personnage que vous voulez modifier ? fghfhhg
Traceback (most recent call last):
File "/home/dev/repo/Sigmanificient/rpg/main.py", line 457, in <module>
if menu(make_choice()) is False:
File "/home/dev/repo/Sigmanificient/rpg/main.py", line 442, in menu
return {
File "/home/dev/repo/Sigmanificient/rpg/main.py", line 386, in char
modify_char(active_player, search_char(active_player, input(
File "/home/dev/repo/Sigmanificient/rpg/main.py", line 271, in modify_char
if not fiche_char(player, character):
File "/home/dev/repo/Sigmanificient/rpg/main.py", line 223, in fiche_char
if character.sexe == 'H':
AttributeError: 'NoneType' object has no attribute 'sexe'
Process finished with exit code 1
The documentation is missing a step to install the mysql-connector-python
package.
A requirements.txt
and a indication within the readme would solve this issue
Could you please add an other
field or just accept user input instead of a binary choice ?
sexe = "Aucun"
if character.sexe == 'H':
sexe = "Homme"
elif character.sexe == 'F':
sexe = "Femme"
Hi, I've noticed that the game uses the MySQL
DBMS (Database Management System).
The user have to install that dependency by they own, which can be difficult on some OS, such a windows.
MySQL is also a pretty heavy piece of software, that wouldn't be of much use for a project of such scale.
Moreover, you then have to create a config for the sole purpose of defining the authentication string to the database.
Using something a sqlite
would be preferable, as it comes without any requirements than the python library use to connect with it. It create a single file for store the whole database, which is more the enough since there is a single schema defining a few tables.
Overall, It would make things easier to install and lighter
I recommend you to read the documentation on the sqlite3 module, here
Every name you enter is detected as Taken
due to test_player
returning a Player
type that is evaluated as True
if test_player(name):
print("Ce nom est déjà prit\n")
return default_player
def test_player(name: str) -> Player:
player = default_player
for all_player in players:
if all_player.name == name:
player = all_player
break
return player
test_player = Player(0, 'test', 0)
print(bool(test_player))
true
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.