moving.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:wargame 作者: maximinus 项目源码 文件源码
def game():
    resources = os.path.join(os.getcwd(), '../')
    controller = wargame.engine.init(resources)
    # add a sprite from an image
    sprite = ImageNode.from_image(100, 100, 'sprites.soldier')

    # we want the unit to move, so add a tween
    # all times are in milliseconds for the engine
    # this move rect is a VECTOR, so we move by this amount
    move = pygame.Rect(300, 0, 0, 0)
    sprite.tween = MoveTween(4000, sprite.rect, move)

    # I add the node to a SCENE
    scene = Scene([sprite])
    # I add the scene to the ENGINE
    controller.add_scene('start', scene)
    # I tell the engine what scene to start and run the controller
    controller.run('start')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号