Last active
May 19, 2016 11:10
-
-
Save indatawetrust/6b06e229848275c158a57b5e9eb385ed to your computer and use it in GitHub Desktop.
cocos2d-x vector array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vector <Sprite *> spriteArray; | |
for(int i=0;i<5;i++) | |
{ | |
auto sprite = Sprite::create("ball.png"); | |
spriteArray.pusbBack(); | |
} | |
int k = 1; | |
for(auto str: spriteArray) | |
{ | |
str->setPosition(Vec2(k * 50,50)); k++; | |
this->addChild(str,1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment