android - Use of Classes in Cocos2d-x to create an "Enemy" to extend Layer -
pretty new cocos2dx , c++ objective-c background. i'm making game can have between 1-10 enemies on screen @ time. each enemy has 1 sprite body , 2 stats (health & damage). in past objective-c i've been able define class.h/class.mm file , fill many variables want (health, speed, height, weight, color, etc), i'm having trouble figuring out how in cocos2dx. here simplified project isolates problem i'm having. i'm sure it's straight forward i'm having trouble looking solution //-----enemy.h #include "cocos2d.h" using_ns_cc; class enemy : public cocos2d::layer{ public: virtual bool init(); create_func(enemy); void sethealth(int val); private: int myhealth; sprite *body; sprite *weapon; }; //-----enemy.cpp #include "enemy.h" using_ns_cc; bool enemy::init() { if ( !layer::init() ) return false; return true; } void sethealth(int newhealth) { //myhealth = newhealth; } //-----hellow...