我知道如何使用批次同时绘制它们,但我想知道是否有办法一次移动整个批次。我需要单独移动所有精灵吗?
到目前为止,我一直在这样做:
tile2 =pyglet.sprite.Sprite(tile1,0,0,batch = terrain)
tile3 =pyglet.sprite.Sprite(tile1,10,0,batch = terrain)
tile4 =pyglet.sprite.Sprite(tile1,20,0,batch = terrain)
tile5 =pyglet.sprite.Sprite(tile1,30,0,batch = terrain)
tile6 =pyglet.sprite.Sprite(tile1,40,0,batch = terrain)
tile7 =pyglet.sprite.Sprite(tile1,50,0,batch = terrain)
tile2.x += 10
tile3.x += 10
tile4.x += 10
ETC...
但是在成品中会有比这更多的精灵(我希望有 50 多个),移动它们会很烦人。
任何帮助将不胜感激 :)