python learning (games)


Game <Monkey Skeleton Demon World War II>
1. identity selector
① the display message
Welcome to XXX game!
Please select your identity:
1. XXX
2. xxx
Please choose: the X-
② to assign the identity of a user selection (display a different prompt message)
1 ....
2 ....
3 ....
2, game Peng line
① displays basic information about the player (ATK value of life)
② display Peng player can operate the line:
1, leveling
- enhance the player's attack power and hit points
2, playing BOSS
- BOSS players Peng-line attack, the player to attack BOSS, BOSS for players to fight back
- calculate whether the player destroys BOSS, BOSS whether the player is to destroy
- the game is over
3, escape
- quit the game, display a message, the end of the game!


= the begin "" " 
=========== Welcome to the game" Skeleton Demon Monkey Wars "===========
Please select your identity:
1. monk
2. White-Boned Demon
," " "
begin_2 =" ""
select an action you want:
1. leveling
2. playing BOSS
3. escape
"" "
MAX = 2
MP = 2
Print (the begin)
select_1 the INPUT = (" select (1-2): ")
iF select_1.isdigit () == False: # determine whether it is a legal digital
print (" your choice is wrong, the system automatically assigned to the Monkey ")  
elif int (select_1) == 1: # when the input content 1
print ( "you choose -> monk <- current attack: 2, current health: 2")
elif int (select_1) == 0:
print ( "your choice is wrong, the system automatically assigned to the monk." )
elif int (select_1) == 2:
Print ( "boss why you choose, automatically selects the monk.")
The else:
Print ( "your choice is wrong, the system automatically assigned to the monk")
print ( "Your identity is -> monk <- Current Attack: 2, current health: 2")
the while True:
Print (begin_2)
select_2 the INPUT = ( "select (1-3):")
IF select_2 = = str (1): # 2 attack power increase each time you run the
MAX + 2 =
MP + = 2
Print ( "your identity is -> monk <- current attack:", MAX, ", current health:" , MP)
elif select_2 str == (2):    
Print ( "start playing BOSS")
IF MAX> 10: # BOSS blood
print ( "! you win, ending the game") # If the attack is more than 10 attacks when will the victory of
the iNPUT ()
Exit ()
the else:
Print ( "you lose, the game is over!")
the iNPUT ()
Exit ()
elif select_2 str == (3):
Print ( "You have chosen to escape, appeared Houge you rescued ")
the INPUT ()
Exit ()
the else:
Print ( "! You make a mistake")
the Continue # skip the end of this cycle, the cycle continues










Guess you like

Origin www.cnblogs.com/wangwen022/p/11299237.html