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


Python Sprite.get方法代码示例

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


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

示例1: update

# 需要导入模块: from sprite import Sprite [as 别名]
# 或者: from sprite.Sprite import get [as 别名]
 def update(self):
     if (self.disturbed):
         self.sprite = Sprite.get('WATER_DISTURBED')
         self.disturbed = False
         return
     self.has_fish = True if random.random() < .05 else False
     if (self.has_fish):
         self.sprite = Sprite.get('WATER_ACTIVE')
     else:
         self.sprite = Sprite.get('WATER')
开发者ID:RylandAlmanza,项目名称:adventure,代码行数:12,代码来源:tiles.py

示例2: pick

# 需要导入模块: from sprite import Sprite [as 别名]
# 或者: from sprite.Sprite import get [as 别名]
 def pick(self):
     if (self.picked == False):
         sprite = Sprite.get('GRASS')
         self.picked = True
         self.solid = False
         self.sprite = sprite
         return Wheat(0, 0)
     else:
         return None
开发者ID:RylandAlmanza,项目名称:adventure,代码行数:11,代码来源:tiles.py

示例3: chop

# 需要导入模块: from sprite import Sprite [as 别名]
# 或者: from sprite.Sprite import get [as 别名]
 def chop(self):
     if (self.chopped == False):
         sprite = Sprite.get('GRASS')
         self.chopped = True
         self.solid = False
         self.sprite = sprite
         return Log()
     else:
         return None
开发者ID:RylandAlmanza,项目名称:adventure,代码行数:11,代码来源:tiles.py

示例4: char_to_entity

# 需要导入模块: from sprite import Sprite [as 别名]
# 或者: from sprite.Sprite import get [as 别名]
 def char_to_entity(self, x, y, char):
     sprite = None
     solid = None
     name = None
     if (char == 'T'):
         return Tree(x, y)
     if (char == '.'):
         sprite = Sprite.get('GRASS')
         solid = False
         name = 'grass'
     if (char == 'c'):
         sprite = Sprite.get('GRASS')
         solid = False
         name = 'grass'
         self.entities.append(Chicken(x, y))
     if (char == '~'):
         return Water(x, y)
     if (char == '"'):
         return Wheat(x, y)
     entity = Entity(x, y, name, sprite)
     entity.solid = solid
     return entity
开发者ID:RylandAlmanza,项目名称:adventure,代码行数:24,代码来源:tilemap.py

示例5: grow

# 需要导入模块: from sprite import Sprite [as 别名]
# 或者: from sprite.Sprite import get [as 别名]
 def grow(self):
     self.picked = False
     self.ticks_since_picked = 0
     self.solid = True
     self.sprite = Sprite.get('WHEAT')
开发者ID:RylandAlmanza,项目名称:adventure,代码行数:7,代码来源:tiles.py

示例6: __init__

# 需要导入模块: from sprite import Sprite [as 别名]
# 或者: from sprite.Sprite import get [as 别名]
 def __init__(self, x, y):
     sprite = Sprite.get('WHEAT')
     super(Wheat, self).__init__(x, y, 'wheat', sprite)
     self.picked = False
     self.ticks_since_picked = 0
     self.solid = False
开发者ID:RylandAlmanza,项目名称:adventure,代码行数:8,代码来源:tiles.py

示例7: __init__

# 需要导入模块: from sprite import Sprite [as 别名]
# 或者: from sprite.Sprite import get [as 别名]
 def __init__(self, x, y):
     sprite = Sprite.get('CHICKEN')
     super(Chicken, self).__init__(x, y, 'chicken', sprite)
     self.owner = None
开发者ID:RylandAlmanza,项目名称:adventure,代码行数:6,代码来源:chicken.py

示例8: __init__

# 需要导入模块: from sprite import Sprite [as 别名]
# 或者: from sprite.Sprite import get [as 别名]
 def __init__(self, x, y):
     sprite = Sprite.get('PLAYER')
     super(Player, self).__init__(x, y, 'player', sprite)
     self.inventory.append(TinderBox())
开发者ID:RylandAlmanza,项目名称:adventure,代码行数:6,代码来源:player.py


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