Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int radius= 32;
- float scaleImage= 0.5;
- int nItem= 60;
- float pMargin= 5;
- int limitTime= 70;
- float timeWaiting= 8;
- bool opTouch= true;
- int lastIndex= -1;
- Size visibleSize;
- CCArray *arrCs;
- bool MainGame::init(){
- arrCs= CCArray::create();
- int xx= pMargin+ radius;
- int yy= pMargin+ radius;
- int inLabel= 0;
- for (int i=0; i<nItem; i++) {
- inLabel= i;
- if (i>((nItem/2)-1)) {
- inLabel= i-(nItem/2);
- }
- CCString *iconName= CCString::createWithFormat("ricon_%i.png", inLabel);
- Sprite *cs= CCSprite::create(iconName->getCString());
- cs->setPosition(Point(xx, yy));
- cs->setTag(-1);
- cs->setScale(scaleImage);
- /*****SET VALUE FOR arrCs ******************/
- arrCs->addObject(cs);
- this->addChild(cs, (1+ rand()%3));
- xx= xx+ (radius*2)+ pMargin;
- if (xx+ (radius/2)> visibleSize.width) {
- xx= radius + pMargin;
- yy= yy+(radius*2)+ pMargin;
- }
- }
- }
- void MainGame::onTouchesEnded(const std::vector<Touch*>& touches, Event* event){
- /******** arrCs has nothing ************/
- for (int i=0; i< arrCs->count(); i++) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement