以下代码将图片旋转一圈
function create() {
followers = this.add.container();
for (let i = 0; i < 3; i++) {
let ball = followers.create(0, 0, 'ball').setScale(0.7);
ball.setData('vector', new Phaser.Math.Vector2());
lal = this.tweens.add({
targets: ball,
z: -1,
ease: 'Linear',
duration: 12370,
repeat: -1,
delay: i * 320
});
}
}
function update() {
balls = followers.getChildren();
for (let i = 0; i < balls.length; i++) {
let t = balls[i].z;
let vec = balls[i].getData('vector');
curve.getPoint(t, vec);
balls[i].setPosition(vec.x, vec.y);
balls[i].setDepth(10);
}
followers.setDepth(10)
}
如何使无限个正方形旋转一圈?例如,使10个正方形旋转一圈与图片一样