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