I am trying to implement the BobUeland Tutorail on 3 missiles cf : http://bobueland.com/cocos2d/?p=145
and among other things he defines sprites as:
“@interface Missile : CCNode {”
to then receive the touch events.
So far in the tutorial on cocos2dx, I could see this kind of declaration rather a “virtual ccTouchBegan” in the class definition (e.g. test/test/controller.h)
does this mean that potential all CCNodes of cocos2d are touch delegates?
No, it means Missile inherits from CCNode, and implements CCTargetedTouchDelegate.
what ob-c in Bob example does is clear, what cocos2d-x is less clear why in tutorial 4 (how to fire some bullet) http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Chapter_4__How_to_Fire_some_Bullets : why not in Helloworld.h of helloworld project? (hence my question are all CCNODE of cocos2d-x touchetargeted delegates or not?
" Declare the callback function “void ccTouchesEnded(cocos2d::CCSet* touches, cocos2d::CCEvent* event);” in HelloWorldScene.h, and realize the function in HelloWorldScene.cpp."
2.
( by the why not virtual void cctouchesEnded? since cctouchesEnded is inherited?)