diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d1ffe85 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Utilisez IntelliSense pour en savoir plus sur les attributs possibles. + // Pointez pour afficher la description des attributs existants. + // Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python Debugger: Current File", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal" + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index f8b6bb8..a77a57d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ # cmd-alexandra-toxicity +## Installation + +1. Télécharger ce dépôt +2. Le Déziper dans un dossier de ton choix (ex: *Mes Documents*) +2. Créer un raccourci de `lancer_jeu.bat` : + 1. Cliquer-droit sur `lancer_jeu.bat` > *Créer un raccourci* + 2. Glisser le raccourci sur le bureau Windows + 3. Cliquer-droit sur le raccourci > *Propriétés* + - Dans l'onglet Raccourci, activer *Exécuter : Agrandie* \ No newline at end of file diff --git a/controleur_de_gaz.py b/controleur_de_gaz.py new file mode 100644 index 0000000..2bb3964 --- /dev/null +++ b/controleur_de_gaz.py @@ -0,0 +1,66 @@ +from time import sleep +from random import uniform as rand +from colorama import init, Fore, Style + + +init(autoreset=True) +code_secret = "TCPTAR".lower() +entree = "" + + +sleep(rand(0.7, 1.7)) +print("Initialisation des capteurs") +sleep(rand(0.7, 1.7)) +print("Analyse des niveaux de gaz") +sleep(rand(0.7, 1.7)) + +print("Détection de gaz toxiques", end="", flush=True) +for i in range(0, 101, 4): + bar = "#" * (i // 4) # remplit la barre selon le pourcentage + print(f"\rDétection de gaz toxiques : [{bar:<25}] {i}%", end="", flush=True) + sleep(rand(0.1, 0.3)) + +print( + "\r" + + Fore.RED + + Style.BRIGHT + + "Détection de gaz toxiques : Confirmé " +) +sleep(rand(0.7, 1.7)) +print("Condition des valves : Ouverte") +sleep(rand(0.7, 1.7)) +print("Procédure de sécurité activée") +sleep(rand(0.7, 1.7)) +print(Style.BRIGHT + "FERMETURE AUTOMATIQUE DES PORTES") +sleep(rand(0.7, 1.7)) + +entree = input("Entrez le code d'accès pour fermeture des valves : ").strip().lower() +while entree != code_secret: + sleep(1) + entree = input("Code invalide! Veillez reesayer : ").strip().lower() + +print("Code validé") +sleep(rand(0.7, 1.3)) +message = "Fermeture des valves" +print(message, end="", flush=True) +for _ in range(3): + sleep(0.5) + print(".", end="", flush=True) + +sleep(rand(0.7, 1.7)) +print("\rFermeture des valves... Valves fermées") +sleep(rand(0.7, 1.7)) +print("Détection de gaz toxiques", end="", flush=True) +for i in range(0, 101, 4): + bar = "#" * (i // 4) # remplit la barre selon le pourcentage + print(f"\rDétection de gaz toxiques : [{bar:<25}] {i}%", end="", flush=True) + sleep(rand(0.1, 0.3)) + +sleep(rand(0.7, 1.7)) +print( + "\r" + + Fore.GREEN + + Style.BRIGHT + + "Détection de gaz toxiques : Néant " +) +sleep(5) diff --git a/lancer_jeu.bat b/lancer_jeu.bat new file mode 100644 index 0000000..a1269aa --- /dev/null +++ b/lancer_jeu.bat @@ -0,0 +1,6 @@ +@echo off +mode con: cols=120 lines=40 +title ESCAPE GAME +cd /d "%USERPROFILE%\Documents\cmd-alexandra-toxicity" +python jeu.py +pause > nul \ No newline at end of file