我尝试在Node.js上使用es6-tween . 我想计算补间,并在更新时通过Websocket将它们发送给客户端 . (需要服务器端)
let coords = { x: 0, y: 0 }; // Start at (0, 0)
let tween = await new Tween(coords)
.to({ x: 100, y: 100 }, 1000)
.on('update', ({x, y}) => {
console.log(`The values is x: ${x} and y: ${y}`);
})
.start();
永远不会调用更新 . 我没有任何错误 . 我怎么能在服务器端使用它?也尝试使用GASP或Tween.js
1 回答
加
并删除
await
.见pen .