New text game and slot formating
This commit is contained in:
parent
6a88650d9c
commit
c654e30d30
4
PyGame/practice/textadvebture/mapdata.json
Normal file
4
PyGame/practice/textadvebture/mapdata.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"title": "The Portents of Doom",
|
||||||
|
"description": "You have ventured into blah blah blah..."
|
||||||
|
}
|
20
PyGame/practice/textadvebture/texadv.py
Normal file
20
PyGame/practice/textadvebture/texadv.py
Normal file
|
@ -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()
|
|
@ -42,7 +42,11 @@ SYMBOL_COLORS = {
|
||||||
"B": Fore.GREEN,
|
"B": Fore.GREEN,
|
||||||
"C": Fore.LIGHTBLUE_EX,
|
"C": Fore.LIGHTBLUE_EX,
|
||||||
"D": Fore.RED,
|
"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.
|
# 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):
|
def check_winings(columns: List, my_bet: int, my_lines: int):
|
||||||
|
@ -135,7 +139,9 @@ def get_bet() -> int:
|
||||||
else:
|
else:
|
||||||
print(" Error: Please enter a number")
|
print(" Error: Please enter a number")
|
||||||
return bet
|
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:
|
def roll(balance) -> int:
|
||||||
lines = get_number_of_lines()
|
lines = get_number_of_lines()
|
||||||
bet = -1
|
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}")
|
print(f"You lost your bet of ${bet} on {lines} lines for a total loss of ${bet*lines}")
|
||||||
balance = balance - (bet * lines)
|
balance = balance - (bet * lines)
|
||||||
return balance
|
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():
|
def main():
|
||||||
balance = deposit()
|
balance = deposit()
|
||||||
# Using "while True" requires a break to exit.
|
# Using "while True" requires a break to exit.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user