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


Python Interface.load_grue_graphics方法代码示例

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


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

示例1: __init__

# 需要导入模块: from Interface import Interface [as 别名]
# 或者: from Interface.Interface import load_grue_graphics [as 别名]
class Main:
    def __init__(self, name):
        self.inv = Inventory()
        self.dim = Portal()
        self.ui = Interface()
        self.loader = BlockLoader()
        
        self.no_quest = Quest(desc="No quest.", name="None")
        self.you = Player(self.inv, name, self.no_quest)
        self.mob1 = Cow()
        self.mob2 = Gnu()
        self.mob3 = Zombie()
        self.mob4 = Grue()
        self.mob5 = Kitty()
        
        self.no_quest = Quest(desc="No quest.", name="None")
        self.hell_quest = Quest(desc="Conquer Hell!", name="Crusader")
        self.sky_quest = Quest(desc="Conquer the Sky Dimension!", name="Hostile Heavenly Takeover")
        self.magic_quest = Quest(desc="Magify something.", name="We Don't Have to Explain It")
        self.
        
        self.sk = SkyKing()
        self.satan = Lucifer()
        
    def clear_screen(self):
        if sys.platform.startswith("win32") or sys.platform.startswith("os2"):
            system("cls")
        else:
            sys.stdout.write('\033[2J')
            sys.stdout.write('\033[H')
            sys.stdout.flush()
    
    def run(self):
        while True:
            self.you.day += 1
            sleep(1)
            self.clear_screen()
            
            if self.you.dimension == "Hell":
                self.run_hell()
            elif self.you.dimension == "Sky Dimension":
                self.run_sd()
            elif self.you.dimension == "Base":
                pass
            else:
                print "ERR"
            
            cowspawn = self.mob1.x == None and self.mob1.y == None and self.mob1.z == None
            zomspawn = self.mob3.x == None and self.mob3.y == None and self.mob3.z == None
            gruespawn = self.mob4.x == None and self.mob4.y == None and self.mob4.z == None
            kittyspawn = self.mob5.x == None and self.mob5.y == None and self.mob5.z == None
            if cowspawn and zomspawn and gruespawn and kittyspawn:
                self.ui.load_peaceful_graphics(self.you)
            elif cowspawn and not zomspawn and gruespawn and kittyspawn:
                self.ui.load_zombie_graphics(self.you, self.mob3)
            elif cowspawn and zomspawn and not gruespawn and kittyspawn:
                self.ui.load_grue_graphics(self.you, self.mob4)
            elif not cowspawn and zomspawn and gruespawn and kittyspawn:
                self.ui.load_cow_graphics(self.you, self.mob1)
            elif cowspawn and zomspawn and gruespawn and not kittyspawn:
                self.ui.load_kitty_graphics(self.you, self.mob5)
            else:
                pass
            
            if not zomspawn:
                zomcheck1 = abs(self.mob3.y) - abs(self.you.y) == 1 and abs(self.mob3.x) - abs(self.you.x) == 0
            else:
                zomcheck1 = False
            if not zomspawn:
                zomcheck2 = abs(self.mob3.x) - abs(self.you.x) == 1 and abs(self.mob3.y) - abs(self.you.y) == 0
            else:
                zomcheck2 = False
            if zomcheck1 or zomcheck2:
                self.you.attack(self.mob3, self.inv)
            else:
                pass
            if not gruespawn:
                gruecheck1 = abs(self.mob4.y) - abs(self.you.y) == 1 and abs(self.mob4.x) - abs(self.you.x) == 0
            else:
                gruecheck1 = False
            if not gruespawn:
                gruecheck2 = abs(self.mob4.x) - abs(self.you.x) == 1 and abs(self.mob4.y) - abs(self.you.y) == 0
            else:
                gruecheck2 = False
            if gruecheck1 or gruecheck2:
                self.you.attack(self.mob4, self.inv)
            else:
                pass
            if not cowspawn:
                cowcheck1 = abs(self.mob1.y) - abs(self.you.y) == 1 and abs(self.mob1.x) - abs(self.you.x) == 0
            else:
                cowcheck1 = False
            if not cowspawn:
                cowcheck2 = abs(self.mob1.x) - abs(self.you.x) == 1 and abs(self.mob1.y) - abs(self.you.y) == 0
            else:
                cowcheck2 = False
            if cowcheck1 or cowcheck2:
                self.you.attack(self.mob1, self.inv)
            else:
                pass
#.........这里部分代码省略.........
开发者ID:inhumanundead,项目名称:genesis,代码行数:103,代码来源:main.py


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