本文整理汇总了Python中Window.addAnimation方法的典型用法代码示例。如果您正苦于以下问题:Python Window.addAnimation方法的具体用法?Python Window.addAnimation怎么用?Python Window.addAnimation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.addAnimation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GLTD
# 需要导入模块: import Window [as 别名]
# 或者: from Window import addAnimation [as 别名]
class GLTD(object):
def __init__(self):
super(GLTD, self).__init__()
self.totalEnemies = 1
self.window = Window()
self.window.addActor(GridActor(0, 0, 600, 600))
self.window.board = BoardActor(0, 0, 600, 600)
self.window.addActor(self.window.board)
self.window.addActor(masterParticleClock) # TODO: unmessify. IMPORTANT
#anim = Animation(20, [], LINEAR)
#self.px = 10.0
#self.py = 10
#anim.onCompletion(self.createNewParticles)
#anim.loop = True
#self.window.addAnimation(anim)
#anim.start()
anim = Animation(1864, [], LINEAR)
anim.onCompletion(self.createNewEnemy)
anim.loop = True
self.window.addAnimation(anim)
anim.start()
#tower = RedL1TowerActor(4,7)
#self.window.addTower(tower)
#tower.start()
#
#tower = RedL1TowerActor(10,5)
#tower.range = 150
#tower.reloadSpeed = 300
#tower.damage = 1000
#tower.shake = 2
#self.window.addTower(tower)
#tower.start()
towerChooser = TowerChooser(600, 300, 200, 300)
self.window.addActor(towerChooser)
tower = RedL1TowerActor(0, 0)
tower.active = False
tower.x = tower.y = 40.0
towerChooser.addActor(tower)
glutMainLoop()
def createNewEnemy(self):
enemy = RedEasyEnemyActor(self.totalEnemies * 100)
self.window.addEnemy(enemy)
enemy.start()
self.totalEnemies += 1
def createNewParticles(self):
if self.py > 600:
return
self.window.addActor(ParticleActor(20*sin(self.px) + 30,self.py))
self.px += 0.5
self.py += 5