本文整理汇总了Python中animation.Animation.next方法的典型用法代码示例。如果您正苦于以下问题:Python Animation.next方法的具体用法?Python Animation.next怎么用?Python Animation.next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类animation.Animation
的用法示例。
在下文中一共展示了Animation.next方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from animation import Animation [as 别名]
# 或者: from animation.Animation import next [as 别名]
def __init__(self):
super(E3Animation, self).__init__()
image = images["E3"]
offsetx, offsety = 57, 37
self.originalAnimation = "runsw"
width, height = 118, 72
playeroffset = 504
y, m, n = 0, 1, 1
self.addAnimationFromSpriteSheetDir(image, 0, y, width, height, m, n, offsetx, offsety, playeroffset, "stand")
y, m, n = 216, 6, 1
self.addAnimationFromSpriteSheetDir(
image, 0, y, width, height, m, n, offsetx, offsety, playeroffset, "run", False, "stand"
)
y, m, n = 288, 6, 1
self.addAnimationFromSpriteSheetDir(
image, 0, y, width, height, m, n, offsetx, offsety, playeroffset, "crawl", False, "stand"
)
y, m, n = 360, 6, 1
self.addAnimationFromSpriteSheetDir(
image, 0, y, width, height, m, n, offsetx, offsety, playeroffset, "attack", False, "stand"
)
y, m, n = 432, 6, 1
self.addAnimationFromSpriteSheetDir(
image, 0, y, width, height, m, n, offsetx, offsety, playeroffset, "crawlattack", False, "stand"
)
x, y, m, n = 2220, 144, 15, 1
self.addAnimationFromSpriteSheet(
image, 0, y, width, height, m, n, offsetx, offsety, playeroffset, "die1", False
)
x, y, m, n = 3330, 144, 15, 1
self.addAnimationFromSpriteSheet(
image, 0, y, width, height, m, n, offsetx, offsety, playeroffset, "die2", False
)
x, y, m, n = 1110, 72, 15, 1
for player in range(2):
animation = Animation()
animation.addImageSpriteSheet(image, x, y, width, height, m, n, offsetx, offsety)
animation.loop = False
animation.next = self.getAnimation("standsw_%d" % (player))
self.addAnimation("cheer_%d" % (player), animation)
y += playeroffset
x, y, m, n = 0, 72, 15, 1
for player in range(2):
animation = Animation()
animation.addImageSpriteSheet(image, x, y, width, height, m, n, offsetx, offsety)
animation.loop = False
animation.next = self.getAnimation("standsw_%d" % (player))
self.addAnimation("squeez_%d" % (player), animation)
y += playeroffset
示例2: __init__
# 需要导入模块: from animation import Animation [as 别名]
# 或者: from animation.Animation import next [as 别名]
def __init__(self):
super(MCVAnimation,self).__init__()
image = images["mcv"]
offsetx,offsety = 94,77
self.originalAnimation = "standne"
width,height = 188,154
playeroffset = 154
y,m,n = 0,1,1
for player in range(2):
x = 0
for direction in ["w","sw","s","se","e","ne","n","nw"]:
animation = Animation()
animation.addImageSpriteSheet(image,x,y,width,height,m,n,offsetx,offsety)
self.addAnimation("stand%s_%d"%(direction,player),animation)
x += width * m * 2
y += playeroffset
y,m,n = 0,1,1
for player in range(2):
x = 0
for direction in ["w","sw","s","se","e","ne","n","nw"]:
animation = Animation()
animation.addImageSpriteSheet(image,x,y,width,height,m,n,offsetx,offsety)
animation.addImageSpriteSheet(image,x,y,width,height,m,n,offsetx,offsety)
animation.addImageSpriteSheet(image,x,y,width,height,m,n,offsetx,offsety)
animation.addImageSpriteSheet(image,x,y,width,height,m,n,offsetx,offsety)
animation.addImageSpriteSheet(image,x,y,width,height,m,n,offsetx,offsety)
animation.addImageSpriteSheet(image,x,y,width,height,m,n,offsetx,offsety)
animation.loop = False
animation.next = self.getAnimation("stand%s_%d"%(direction,player))
self.addAnimation("run%s_%d"%(direction,player),animation)
x += width * m * 2
y += playeroffset
x,y,m,n = 0,0,16,1
for player in range(2):
animation = Animation()
animation.addImageSpriteSheet(image,x,y,width,height,m,n,offsetx,offsety)
animation.loop = False
self.addAnimation("expand_%d"%(player),animation)
y += playeroffset
示例3: range
# 需要导入模块: from animation import Animation [as 别名]
# 或者: from animation.Animation import next [as 别名]
whitesurf = pygame.surface.Surface((200, 200))
whitesurf.fill((255, 255, 255))
for x in range(4):
redsurf.fill((255, 0, 0, 127))
rs = pygame.surfarray.array3d(redsurf)
noise_small = numpy.random.random((200, 150)) * 0.2 + 0.4
noise_big = noise_small.repeat(4, 0).repeat(4, 1)
rs = (rs.astype(noise_big.dtype) * noise_big[:, :, numpy.newaxis]).astype(rs.dtype)
redsurf = pygame.surfarray.make_surface(rs).convert_alpha()
os = pygame.surfarray.pixels_alpha(redsurf)
os[:] = 127
del rs
del os
tiles[x] = redsurf
linesize = 3
tilesurf = realtileani.next()
overlay = None
oy = 0.
i=-1
# v-----------------------------------------------------------------v
# ^-----------------------------------------------------------------^
clock = pygame.time.Clock()
Truth = True
time = 0.
tm = 0.
x = 50
while Truth:
dt = clock.tick(30)/1000.
time += dt
tm += dt
y = -size[1] + (size[1] * time) / secs