1. Create a SKPhysicsBody to the SKSpriteNode.
2. Add an SKAction.rotate to the SKSpriteNode.
3. Then set the xScale to -1 for SKSpriteNode ( in touchesBegan )
4. the result is that the SKAction is reversed wrongly
5. .....
6. Next, instead of SKSpriteNode, set the xScale to -1 for SKNode ( in touchesBegan )
7. this time, the SKPhysicsBody and the SKSpriteNode are separated each into mirrored SKActions
这是一个bug,还是可以通过某种方式修复(不需要创建和添加镜像版本的SKSpriteNode)
谢谢你的帮助
发布于 2017-09-13 00:27:41
在第一种情况下,在应用旋转之前的sprite天平,这就是为什么它仍然沿着相同的方向前进,就好像没有翻转一样。
在第二种情况下,应用旋转后的雪碧刻度,这就是你现在得到正确方向的原因。
至于SKPhysicsBody,它是一个错误,它们是如何应用仿射转换更改的。
它不会发现数字的符号,这就是为什么身体走错了方向。
https://stackoverflow.com/questions/46185957
复制相似问题