main.py
#!/usr/bin/python
#_*_coding:utf-8_*_
'''
I create a psychological game , here's 5 parts of the game :
Body_Health,Love,Inter_Communication,Internet and Study.
Creater : lippor
Time:Mon Mar 20
命名规则:
class:小写_组合
def:小写_组合
doc:小写_组合
parameter:首字母大写_组合
module:首字母大写_组合
'''
import random
import os
import sys
import re
import time
#导入各个游戏模块
import Body_Health
import Love
import Inter_Communication
import Internet
import Study
# 不能使用Tab键在字典KEY前面进行缩进。
Part = {
1:'Body_Health:\n\tThis is the capital of our revolution.',
2:"Love:\n\tlove is the world's most warm seek.",
3:'Inter_Communication:\n\twithout you, I will accomplish nothing.',
4:'Internet:\n\tthe spider is not terrible, terrible is unable to find the direction of the spider.',
5:'Study:\n\twe can not give up the pursuit of excellence in life.'
}
# the main def
#游戏开始主函数:
def Game_Start():
print """
Welcome to take part in this wonderful psychological game !
At the begging,you need make a choice from the follow five parts in Random Mode :
Body_Health,Love,Inter_Communication,Internet and Study.
Are you ready ? (Y & N)
"""
Begin_Chioce = raw_input('> ')
Game_Chioce(Begin_Chioce)
#游戏模块选择函数:
def Game_Chioce(Begin_Chioce):
if Begin_Chioce == 'Y':
#print "You are very lucky,you choose the part:", random.randint(1, 6)
#print "You are very lucky,you choose the part:", int(random.randint(1, 6))
#Choose = Part[int(random.randint(1, 6))]
Choose = Part[2]
print "You are very lucky,you choose the part:%s"%Choose
if Choose == Part[1]:
#调用模块中的类的时候,需要先加上模块的名称作前缀。
#B = Body_Health.body_health()
Body_Health.start()
print "Do you want to go on this interesting game? Y or N"
Go_On = raw_input('> ')
if Go_On == 'Y':
Game_Start()
else:
print "Thanks for your playing! Welcome to play this game again ! Bye~"
#Body_Health.body_healt.start()
elif Choose == Part[2]:
#print "ll"
#L = Love.love()
Love.start()
elif Choose == Part[3]:
print "ll"
#inter_communication.start()
elif Choose == Part[4]:
print "ll"
#internet.start()
elif Choose == Part[5]:
print "ll"
#study.start()
else:
print "the system has an error *^*"
Game_Start()