當前位置: 首頁>>代碼示例>>Python>>正文


Python Sprite.__init__方法代碼示例

本文整理匯總了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)
開發者ID:codelurker,項目名稱:UGUIR,代碼行數:27,代碼來源:monsters.py

示例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)
開發者ID:codelurker,項目名稱:UGUIR,代碼行數:28,代碼來源:player.py

示例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)
開發者ID:puffnfresh,項目名稱:blank_page,代碼行數:27,代碼來源:main.py

示例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"
開發者ID:ih,項目名稱:sort_exp,代碼行數:7,代碼來源:selectable.py


注:本文中的pyglet.sprite.Sprite.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。