Skip to content

Instantly share code, notes, and snippets.

@chiiph

chiiph/gist:4374895

Last active Dec 10, 2015
Embed
What would you like to do?
std::shared_ptr<GameObject> gameObject { std::make_shared<GameObject>("Bomb") };
cocos2d::CCLabelTTF *myLabel = cocos2d::CCLabelTTF::create("Explode!", "Arial", 30.0f);
auto myLambda = [gameObject]()
{
if (gameObject.use_count() > 1)
{
gameObject->explode();
}
});
cocos2d::CCMenuItemLabel *myItem = cocos2d::CCMenuItemLabel::createWithBlock(myLabel, myLambda);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.