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


Python Inventory.removeself方法代码示例

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


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

示例1: Level

# 需要导入模块: from inventory import Inventory [as 别名]
# 或者: from inventory.Inventory import removeself [as 别名]
class Level(LevelBase):
    prevlevel = 0
    dialog = 0
    pdialog = 0
    timer = 0
    oldPos = (0, 0)
    dialog = 0
    btimer = 0
    lockedatmessage = 0
    inbattle = 0
    
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Airport'
        # current level
        TW,TH = 32,32

        # load tile set
        g.tga_load_tiles(os.path.join("textures",  "tiles6.png"), (TW,TH), self.tdata)
        g.tga_load_level(os.path.join("levels",  "level28.tga"), 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)

        self.vats = Inventory(g, 'plane')
        self.vats.pos((18, 9))

        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
        self.g.player.hidden = 0
        self.pan_camera(None)
        self.initBack('bg3.png', 190, 512)
        self.effect = GameEffect(g,'wind')
        pygame.mixer.music.load(os.path.join("ambient",  "amb15.ogg"))
        pygame.mixer.music.play(40000)
        
        self.fox = Character("fox.png","facefox.tga", g, 'fox')
        self.fox.pos((31, 15))
        self.fox.direction = 0
        self.fox.health = 40
        self.fox.healthmax = 40

        self.director = Character("director.png","facedirector.png", g, 'director')
        self.director.pos((36, 16))
        self.director.direction = 1
        
        if 'scene16' in g.saveData:
            self.fox.hidden = 1
        if 'scene17' in g.saveData:
            self.fox.feeling = 'dead'
            self.director.hidden = 1
        # plane is gone if you got imas backup tape
        if 'i_tape' in g.saveData:
            self.vats.removeself()
        self.invbox = 0


    # ugly, ugly monsters
    def add_monster (self,g,r,a):
        Monster5(self.g, (r.rect.x, r.rect.y))

    # upon moving
    def playerMove(self, g,r,a):
        print 'player move'
        if self.prevlevel == 29:
            g.player.rect.x,g.player.rect.y = r.rect.x,r.rect.y - 2
            g.view.x = r.rect.x
            g.view.y = r.rect.y


    # draw back of level
    def draw_back(self):
        test = self.draw_gradent((105,70,70), (0, 30, 255))
        self.g.screen.blit(test, (0,0))

    # when you're over a change level tile
    def change_level(self, g,r,a):
        if a.__class__.__name__ != 'Player':
            return
        if g.player.pos[0] == 64:
            g.currentLevel = 29
        if g.player.pos[0] == 1:
            g.currentLevel = 27
        print g.player.pos

    # level events
    def level_loop(self):
        g = self.g

        if self.g.player.pos[0] > 24:
            if not 'scene16' in g.saveData:
                g.intermission = 1
                self.pan_camera(self.fox)
                if self.dialog == 0:
                    self.dialog = 1

                if self.dialog != 0:
                    if g.keyup:
                        self.dialog += 1
                        self.contains_msg_box_counter = 0
                if self.dialog == 2:
#.........这里部分代码省略.........
开发者ID:torleif,项目名称:Dystopian-Future,代码行数:103,代码来源:level28.py


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