本文整理汇总了Python中pyglet.sprite.Sprite.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Sprite.__init__方法的具体用法?Python Sprite.__init__怎么用?Python Sprite.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyglet.sprite.Sprite
的用法示例。
在下文中一共展示了Sprite.__init__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyglet.sprite import Sprite [as 别名]
# 或者: from pyglet.sprite.Sprite import __init__ [as 别名]
def __init__(self, img,
map=None,
pos=None,
stats=None,
x=0, y=0,
blend_src=pyglet.gl.GL_SRC_ALPHA,
blend_dest=pyglet.gl.GL_ONE_MINUS_SRC_ALPHA,
batch=None,
group=None,
usage='dynamic'):
if stats is None:
self.stats = Stats(self)
else:
self.stats = stats
self.map = map
self.pos = pos
self.blocked = True
self.oldPos = pos
self.playerOldPos = None
self.dead = False
self.currentPath = []
Sprite.__init__(self, img,
x, y, blend_src,
blend_dest, batch,
group, usage)
示例2: __init__
# 需要导入模块: from pyglet.sprite import Sprite [as 别名]
# 或者: from pyglet.sprite.Sprite import __init__ [as 别名]
def __init__(self,
x=0, y=0, map=None,
blend_src=pyglet.gl.GL_SRC_ALPHA,
blend_dest=pyglet.gl.GL_ONE_MINUS_SRC_ALPHA,
pos=None,
batch=None,
group=None,
usage='dynamic',
):
self.dead = False
self.charName = 'Player'
self.charClass = 'Fighter'
self.map = map
self.mbox = msgBox()
img = sheet['class'][79]
self.stats = Stats(self, Con=18, hpRoll=20)
self.statuswindow = statusWindow(self, batch, group)
if pos is None:
self.pos = Position()
else:
self.pos = pos
Sprite.__init__(self, img,
x, y, blend_src,
blend_dest, batch,
group, usage)
示例3: __init__
# 需要导入模块: from pyglet.sprite import Sprite [as 别名]
# 或者: from pyglet.sprite.Sprite import __init__ [as 别名]
def __init__(self, x, y, dx, dy, goo_batch):
image = pyglet.image.load(data.filepath('goo.png'))
self.sequence = pyglet.image.ImageGrid(image, 1, 4)
self.splat_image = pyglet.image.load(data.filepath('splat.png'))
self.splat_image.anchor_x = self.splat_image.width / 2
for sequence_image in self.sequence:
sequence_image.anchor_x = sequence_image.width / 2
sequence_image.anchor_y = sequence_image.height / 2
Sprite.__init__(self, image, batch=goo_batch)
self.x = self.xpos = x
self.y = self.ypos = y
self.speedx = dx
self.speedy = dy
self.animation_time = 0
self.animation_frame = 0
self.animation_speed = 0.25
self.splat = False
self.hitbox = (0, 0, self.splat_image.width, self.splat_image.height)
示例4: __init__
# 需要导入模块: from pyglet.sprite import Sprite [as 别名]
# 或者: from pyglet.sprite.Sprite import __init__ [as 别名]
def __init__(self, image, x, y, batch=None, label=None):
Sprite.__init__(self, image, x, y, batch=batch)
self.selected=False
self.label=label
print "derived"