Skip to content

Instantly share code, notes, and snippets.

@chiiph
Last active December 10, 2015 03:28
Show Gist options
  • Save chiiph/4374895 to your computer and use it in GitHub Desktop.
Save chiiph/4374895 to your computer and use it in GitHub Desktop.
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