简体   繁体   English

Android cocos2d

[英]Android cocos2d

我是android cocos2d的新手,后来我使用player1和player2 CCSprites n创建了一个游戏,以便将player1和player2移至精灵位置,这变得很复杂。请提供所需的文档或解决方案。

You have to use move to actions for moving sprite and then run that actions on your player 您必须使用“移动到”动作来移动精灵,然后在播放器上运行该动作

    CCMoveTo moveTo = CCMoveTo.action(0.5f, CGPoint.ccp(x, y));
    mPlayer1.runAction(moveTo);

where x and y are the points where you want to move your sprite and 0.ff is time interval to complete that Action. 其中x和y是您要移动精灵的点,0.ff是完成该动作的时间间隔。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM