void Base::insBullet(float dt) { _bullet=CCSprite::createWithSpriteFrameName("bullet.png"); _batchNode->addChild(_bullet); _bulletArray->addObject(_bullet); _bullet->setScale(0.4f); CCSize winSize =CCDirector::sharedDirector()->getWinSize(); if(_beAft==true) { _bullet->setPosition(ccp(_cat->getPosition().x+_cat->getContentSize().width/2,_cat->getPosition().y)); _bullet->runAction(CCSequence::create(CCMoveTo::create(0.4f,ccp(_bullet->getPosition().x+winSize.width/2,_cat->getPosition().y)),CCCallFuncN::create(this,callfuncN_selector(Base::bulletRemove)),NULL)); }else{ _bullet->setPosition(ccp(_cat->getPosition().x-_cat->getContentSize().width/2,_cat->getPosition().y)); _bullet->runAction(CCSequence::create(CCMoveTo::create(0.4f, ccp(_bullet->getPosition().x - winSize.width / 2, _cat->getPosition().y)), CCCallFuncN::create(this, callfuncN_selector(Base::bulletRemove)), NULL)); } _cat->_isShootOver=false; }
当前所在位置与一段位移之和
开源分布式搜索平台ELK(Elasticsearch+Logstash+Kibana)入门学习资源索引,布布扣,bubuko.com
开源分布式搜索平台ELK(Elasticsearch+Logstash+Kibana)入门学习资源索引
原文:http://blog.csdn.net/gaoyingju/article/details/23750563