From c654e30d30cf95669515a8fcfa844aa38e75d871 Mon Sep 17 00:00:00 2001 From: Stephen Deaton Date: Tue, 2 Jul 2024 18:22:42 -0400 Subject: [PATCH] New text game and slot formating --- PyGame/practice/textadvebture/mapdata.json | 4 ++++ PyGame/practice/textadvebture/texadv.py | 20 ++++++++++++++++++++ PyGame/practice/textslot.py | 13 ++++++++++--- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 PyGame/practice/textadvebture/mapdata.json create mode 100644 PyGame/practice/textadvebture/texadv.py diff --git a/PyGame/practice/textadvebture/mapdata.json b/PyGame/practice/textadvebture/mapdata.json new file mode 100644 index 0000000..d1ea945 --- /dev/null +++ b/PyGame/practice/textadvebture/mapdata.json @@ -0,0 +1,4 @@ +{ + "title": "The Portents of Doom", + "description": "You have ventured into blah blah blah..." +} \ No newline at end of file diff --git a/PyGame/practice/textadvebture/texadv.py b/PyGame/practice/textadvebture/texadv.py new file mode 100644 index 0000000..4ac2a6e --- /dev/null +++ b/PyGame/practice/textadvebture/texadv.py @@ -0,0 +1,20 @@ + + +def game(): + + answer=input('Would you like to play a game?(y/n)') + + if answer.lower() =='y': + print('Welcome to the Adventure') + start = True + inventory = [] + + else: + print( 'Ok Maybe Some other time' ) + + + + + + +game() \ No newline at end of file diff --git a/PyGame/practice/textslot.py b/PyGame/practice/textslot.py index 9de7f93..dbca04e 100644 --- a/PyGame/practice/textslot.py +++ b/PyGame/practice/textslot.py @@ -42,7 +42,11 @@ SYMBOL_COLORS = { "B": Fore.GREEN, "C": Fore.LIGHTBLUE_EX, "D": Fore.RED, - "\u06de": Fore.MAGENTA + "\u06de": Fore.MAGENTA, + "\u16b0": Fore.YELLOW, + "\u16ca": Fore.WHITE, + "\u16d4": Fore.BLUE, + "\u16f8": Fore.LIGHTCYAN_EX } # This function does the calculations for the bet to see if the user won or lost. def check_winings(columns: List, my_bet: int, my_lines: int): @@ -135,7 +139,9 @@ def get_bet() -> int: else: print(" Error: Please enter a number") return bet -#This takes the bet rows and random sybmols from other functions and spits out if they win or lose and how much. + +# This takes the bet rows and random sybmols from other functions and spits out if +# they win or lose and how much. def roll(balance) -> int: lines = get_number_of_lines() bet = -1 @@ -160,7 +166,8 @@ def roll(balance) -> int: print(f"You lost your bet of ${bet} on {lines} lines for a total loss of ${bet*lines}") balance = balance - (bet * lines) return balance -#This loop is the playing fucntion that takes the bet and seees if they have anymore mony to bet with or if they want to keep going. + +# This loop is the playing fucntion that takes the bet and seees if they have anymore mony to bet with or if they want to keep going. def main(): balance = deposit() # Using "while True" requires a break to exit.