简单游戏开发,雷霆战机的源码//创建一个精灵
sprite = CCSprite.sprite("p.png");
this.addChild(sprite);
CGPoint point = CGPoint.ccp(200, 200);
sprite.setPosition(point);
// CCMoveTo moveTo = CCMoveTo.action(2, CGPoint.ccp(300, 600));
// sprite.runAction(moveTo);
//
// CCMoveBy moveBy = CCMoveBy.action(2, CGPoint.ccp(300, 600));
// sprite.runAction(moveBy);
}
@Override
public boolean ccTouchesBegan(MotionEvent event) {
// CCMoveTo moveTo = CCMoveTo.action(2, CGPoint.ccp(300, 600));
// sprite.runAction(moveTo);
// CCMoveTo moveTo = CCMoveTo.action(2, CGPoint.ccp(300, 600));
// sprite.runAction(moveTo);
CCMoveBy moveBy = CCMoveBy.action(2, CGPoint.ccp(300, 600));
sprite.runAction(moveBy);
Log.d("Game01", "用户点击了屏幕");
return super.ccTouchesBegan(event);
评论0
最新资源