I didn't find any gold coin animation. I could only use a zombie to demonstrate it. The principle is the same. (It can be used to place gold coins like cool run or temple escape)
Look:
The principle is the following code. Gold Coins can be placed everywhere as needed;
void JsLayer::initJsSprite(){ CCTMXObjectGroup *objGroup =_map->objectGroupNamed("objects"); CCArray *objArray = objGroup->getObjects(); if (objArray && objArray->count() > 0) { CCObject* pObj = NULL; CCARRAY_FOREACH(objArray, pObj) { CCDictionary* playerPointDic= (CCDictionary*)pObj; /*CCDictElement *keyString = NULL; CCDICT_FOREACH(spawnPoint, keyString) { const char *xps = keyString->getStrKey(); CCLog("dict:key %s", xps); CCString *xps1 = (CCString *)(keyString->getObject()); CCLog("dict:value %f", xps1->floatValue()); } */ float X = playerPointDic->valueForKey("x")->floatValue(); float Y = playerPointDic->valueForKey("y")->floatValue(); this->_jsSprite =JsSprite::create(); this->_jsBatchNode->addChild(this->_jsSprite); this->_jsSprite->setScale(0.5); this->_jsSprite->setPosition(ccp(X,Y)); } }
Let me add another point: it is the object Layer of the map. The objects in the map represent the dictionary. We can traverse all the Key values in the dictionary to determine all coordinates that the genie wants to put.