Hello all
i have some old code that is using some previuse cocos2d-x version , i try to upgread the code i have to the newer version
but i get compilation error :
this is the function i have :
`void Terrain::move (float xMove) {
if (xMove < 0) return;
if (_startTerrain) {
if (xMove > 0 && _gapSize < 5) _increaseGapTimer += xMove;
if (_increaseGapTimer > _increaseGapInterval) {
_increaseGapTimer = 0;
_gapSize += 1;
}
}
this->setPositionX(this->getPositionX() - xMove);
Block * block;
block = (Block *) _blocks->objectAtIndex(0);
if (m_tPosition.x + block->getWidth() < 0) {
_blocks->removeObjectAtIndex(0);
_blocks->addObject(block);
m_tPosition.x += block->getWidth();
float width_cnt = this->getWidth() - block->getWidth() - ((Block *) _blocks->objectAtIndex(0))->getWidth();
this->initBlock(block);
this->addBlocks(width_cnt);
}
}`
im getting this compilation error :
1> Terrain.cpp 1>d:\dev\cpp\cocos2d-x\cocos2d-2.1rc0-x-2.1.3\cocos2d-2.1rc0-x-2.1.3\victorianrushhour\classes\terrain.cpp(188): error C2065: 'm_tPosition' : undeclared identifier 1>d:\dev\cpp\cocos2d-x\cocos2d-2.1rc0-x-2.1.3\cocos2d-2.1rc0-x-2.1.3\victorianrushhour\classes\terrain.cpp(188): error C2228: left of '.x' must have class/struct/union 1> type is ''unknown-type'' 1>d:\dev\cpp\cocos2d-x\cocos2d-2.1rc0-x-2.1.3\cocos2d-2.1rc0-x-2.1.3\victorianrushhour\classes\terrain.cpp(193): error C2065: 'm_tPosition' : undeclared identifier 1>d:\dev\cpp\cocos2d-x\cocos2d-2.1rc0-x-2.1.3\cocos2d-2.1rc0-x-2.1.3\victorianrushhour\classes\terrain.cpp(193): error C2228: left of '.x' must have class/struct/union 1> type is ''unknown-type''
>
i can see that there is instance in CCPlace class , but when i include the #include “actions\CCActionInstant.h” it doesn’t help .
how can i post it ?