Hi !
I am new with Coco2d-X. I am trying to convert my Coco2d-iOS game to Coco2d-X…
iOS VERSION OF MY CODE:
MyObject.h file:
@interface MyObject : CCNode {
//CODE…
}
=> MyObject inherits from CCNode
Main.m file init" method)
*myObject = ;
=> everything works properly
C++ VERSION:
MyObject.h file:
class MyObject : public cocos2d::CCNode
{
}
=> MyObject inherits from CCNode
Main.cpp file method)
*myObject = MyObject::node();
=> returns the following error: “Semantic Issue: Assigning to ‘MyObject ’ from incompatible type ’cocos2d::CCNode’”
I don’t understand why as node() method exists in CCNode and MyObject inherits from CCNode.
Where is my error ?
Thanks !