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


Python Level.Setup方法代码示例

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


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

示例1: introsetup

# 需要导入模块: from Level import Level [as 别名]
# 或者: from Level.Level import Setup [as 别名]
'''
intro._look = '''The mean streets of Cybercity swim below, glistening rain-flecked cars rushing in either direction, 
traffic appearing and disappearing like ones and zeroes in the bitstream, insert serial bus joke. On the other side of the street, hackers hang out by the neon-lit "Import-Export",
hacking fingers itchy from underuse, ready for a fight. Just another day in Cybercity. Except it looks like it's night because cyberpunk.'''
intro._death = '''A cyberpigeon craps on you, rancid droppings seeping into a cut inflicted by the barber as they shaved your cool cyber-do. 
Weeks later, in hospital, you succumb to the bit rot.'''
def introsetup(game):
    vars = game.Vars()
    vars["inventory"] = ["sword", "haxsnax"]
    if "trex" in vars:
        vars.pop("trex")
    if "cyberogres" in vars:
        vars.pop("cyberogres")
    if "llama" in vars:
        vars.pop("llama")
intro.Setup = introsetup

# -------------------------------------------------- #


streets = Level("streets")
streets._text = '''You land on the mean streets of Cybercity. Cars rush past, glittering like rain-flecked pearls in the neon streetlamps, 
even though it's like noon, because this is cyberpunk and actual sunlight is illegal or something. There are two cyberogres in front of you, 
having patiently observed you as you glide to the ground. A feral $ANIMALNAME stares at the scene from an alleyway.'''
streets._look = '''The cyberogres look mean! Better hope you have a weapon, $PLAYERNAME, or you're bit-toast.'''
streets._death = '''You see a bitcoin on the street and bend down to pick it up. You are killed by a combination of crippling deflation, 
wild value fluctuations and the fevered masturbation fantasies of people who live in the mountains and hide gold under their mattresses.'''
def streetssetup(game):
    game.Vars()["cyberogres"] = Animals.MakeAnimal("cyberogres")
    animalname = game.Vars()["animalname"]
    game.Vars()[animalname] = Animals.MakeAnimal(animalname)
开发者ID:samgeen,项目名称:hackandslash,代码行数:33,代码来源:LevelData.py


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