本文整理汇总了Python中sprite.Sprite.kill方法的典型用法代码示例。如果您正苦于以下问题:Python Sprite.kill方法的具体用法?Python Sprite.kill怎么用?Python Sprite.kill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sprite.Sprite
的用法示例。
在下文中一共展示了Sprite.kill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: guiFifhtLayer
# 需要导入模块: from sprite import Sprite [as 别名]
# 或者: from sprite.Sprite import kill [as 别名]
class guiFifhtLayer(cocos.layer.base_layers.Layer):
def __init__(self,heros=[],enemies=[]):
cocos.layer.base_layers.Layer.__init__(self)
image = pyglet.image.load('img/GUI/fight_gui.png')
sprite = cocos.sprite.Sprite(image,position = (5,5), anchor=(0,0))
self.add(sprite)
colorBar = (31,31,31,255)
self.heros = heros
self.enemies = enemies
self.hpbar1 = Bar((14,93),336,self.heros[0].hpl,self)
self.mpbar1 = Bar((14,68),336,self.heros[0].mp,self)
self.hpbar2 = Bar((451,93),336,self.heros[1].hpl,self)
self.mpbar2 = Bar((451,68),336,self.heros[1].mp,self)
self.schedule(self.callback)
self.active = 0
command_l = ['fight','skills','items']
self.commands = []
self.commands.append([])
self.commands.append([])
self.sub_menu = [
cocos.sprite.Sprite('img/GUI/sub_menu.png',position=(5,5),anchor=(0,0)),
cocos.sprite.Sprite('img/GUI/sub_menu.png',position=(404,5),anchor=(0,0))
]
self.sub_list = []
self.sub_list.append([])
self.sub_list.append([])
self.sub_list_add = []
self.sub_list_add .append([])
self.sub_list_add .append([])
pos1 = (20,110)
pos2 = (420,110)
posa1 = (200,110)
posa2 = (600,110)
color = (36,36,36,255)
for skill in range(4):
label1 = cocos.text.Label(text='',position = pos1, font_name = 'Statix', color= color , font_size = 20, anchor_x = 'left')
label2 = cocos.text.Label(text='',position = pos2, font_name = 'Statix', color= color , font_size = 20, anchor_x = 'left')
labela1 = cocos.text.Label(text='',position = posa1, font_name = 'Statix', color= color , font_size = 20, anchor_x = 'left')
labela2 = cocos.text.Label(text='',position = posa2, font_name = 'Statix', color= color , font_size = 20, anchor_x = 'left')
label1.visible = False
label2.visible = False
labela1.visible = False
labela2.visible = False
pos1 = pos1[0], pos1[1] - 30
pos2 = pos2[0], pos2[1] - 30
posa1 = posa1[0], posa1[1] - 30
posa2 = posa2[0], posa2[1] - 30
self.add(label1, z=6)
self.add(label2, z=6)
self.add(labela1, z=6)
self.add(labela2, z=6)
self.sub_list[0].append(label1)
self.sub_list[1].append(label2)
self.sub_list_add[0].append(labela1)
self.sub_list_add[1].append(labela2)
self.menu_level = 0
self.bar_visible = -1
for menu in self.sub_menu:
self.add(menu,z=5)
menu.visible = False
pos = (420,13)
color = (36,36,36,255)
selected_color = (197,197,197,255)
for cmd in command_l:
label = cocos.text.Label(text=cmd,position = pos, font_name = 'Statix', color= color , font_size = 20, anchor_x = 'left')
self.add(label,z=2)
self.commands[1].append(label)
#.........这里部分代码省略.........