Guys,
I need help.
I’m trying to update this game: [[http://www.raywenderlich.com/37701/how-to-make-a-tower-defense-game-tutorial]]
source code [[https://github.com/kmuzykov/TowerDefence-Cocos2d-x]]
to v3.0 rc0 and I’m getting errors on callbacks:
this is the code to update:
//Bullet actions: Move from turret to enemy, then make some damage to enemy, and finally remove bullet sprite.
CCMoveTo* move = CCMoveTo::create(0.1f, chosenEnemy->getPosition());
CCCallFunc* damage = CCCallFunc::create(this, callfunc_selector(Tower::damageEnemy));
CCCallFunc* remove = CCCallFuncN::create(this, callfuncN_selector(Tower::removeBullet));
CCSequence* actions = CCSequence::create(move, damage, remove, NULL);
and this what I did:
MoveTo* move = MoveTo::create(0.1f, chosenEnemy->getPosition());
CallFunc* damage = CallFunc::create(callfunc_selector(Tower::damageEnemy));
CallFunc* remove = CallFuncN::create(callfuncN_selector(Tower::removeBullet));
Sequence* actions = Sequence::create(move, damage, remove, NULL);
It’s failing with :
Error 355 error C2440: 'static_cast' : cannot convert from 'void (__thiscall Tower::* )(cocos2d::Sprite *)' to 'cocos2d::SEL_CallFuncN'
Error 356 error C2440: 'static_cast' : cannot convert from 'void (__thiscall Tower::* )(void)' to 'cocos2d::SEL_SCHEDULE'
Error 357 error C2440: 'static_cast' : cannot convert from 'void (__thiscall Tower::* )(void)' to 'cocos2d::SEL_SCHEDULE'
Error 358 error C2440: 'static_cast' : cannot convert from 'void (__thiscall Tower::* )(void)' to 'cocos2d::SEL_SCHEDULE'
Also I’ve problems with scheduling:
this->schedule(schedule_selector(Tower::shootWeapon), fireRate);
It is failing with :
IntelliSense: invalid type conversion
I’m using Windows/Visual Studio C++ for this. I haven’t tried on Mac/Xcode yet.
What is wrong? Could someone please try to upgrade this code and see what happens?
Thanks!