当前位置: 首页>>代码示例>>Python>>正文


Python Trainer.age方法代码示例

本文整理汇总了Python中trainer.Trainer.age方法的典型用法代码示例。如果您正苦于以下问题:Python Trainer.age方法的具体用法?Python Trainer.age怎么用?Python Trainer.age使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在trainer.Trainer的用法示例。


在下文中一共展示了Trainer.age方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Trainer

# 需要导入模块: from trainer import Trainer [as 别名]
# 或者: from trainer.Trainer import age [as 别名]
# Create the basic of player
player = Trainer(location_object=bp)

"""
"Tutorial" or prologue in the game. The player create your own character.
"""

print("Welcome to the PokeHunter 1.0")
print("All instructions or available choices will be in [] .. Follow them! ;)")
input("[Any button to skip]")
player.name = input("I greet you, stranger! My name is professor Oak. What's yours?\n")
age = input("And.. How old are you?\n")
while True:
    try:
        player.age = int(age)
        break
    except ValueError:
        age = input("Please, give me a number!\n")
gender = input("I see not well, so please, tell me! What is your gender?\n[female/male]\n")
while gender not in player.gender:
    gender = input("Please, select an available!\n")
player.gender = gender
starting_pokemon_object = input("I can offer one pokemon from below.\n[Charizard/Squirtle/Bulbasaur]\n")
while starting_pokemon_object not in Trainer.available_pokemon_names:
    starting_pokemon_object = input("Please, select an available!\n")
if starting_pokemon_object == 'Charizard':
    player.starting_pokemon_object = ch
elif starting_pokemon_object == 'Squirtle':
    player.starting_pokemon_object = sq
elif starting_pokemon_object == 'Bulbasaur':
开发者ID:matolaypal,项目名称:poke-hunter,代码行数:32,代码来源:main.py


注:本文中的trainer.Trainer.age方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。