Open ChenZhongPu opened 10 years ago
There is a bug in org.cocos2d.actions.base CCFollow.java . Modify step routine as following code, then you will find the test demo works as expected.
public void step(float dt) { ... target.setPosition(CGPoint.ccp(CLAMP(tempPos.x,rightBoundary,leftBoundary), CLAMP(tempPos.y,topBoundary,bottomBoundary))); ... }
In the test demo, the Follow Action should make the sprite be centered. However, it didn't work well as expected.