Hi,
I am learning to use cocos2d-x and I am working in a racer game, I have done a camera that follow one sprite, but for any reason, I am getting a strange behavior from another sprite.
Let me put you in the mood.
m_Background = new background();
m_Background ->init();
m_Background ->convertToWorldSpace(Vec2(0.0f, 0.0f));
this->addChild(m_Background , 0);
m_Car= new Car();
m_Car->init();
m_Car->convertToWorldSpace(Vec2(0.0f, 0.0f));
m_Car->m_spriteCar->setCameraMask((unsigned short)CameraFlag::USER1,true);
this->addChild(m_Car, 0);
m_Camera = Camera::create();
m_Camera->setCameraFlag(CameraFlag::USER1);
m_Camera->setPosition3D(Vec3(m_playerCar->getPositionX(), m_playerCar->getPositionY(), 500.0f));
m_Car->addChild(m_Camera);
well,… when I am moving the car, the background is at position 0,0 but is on the screen, and the position value of car is changing but it isn’t shown on the screen any idea?
If I put off the camera, the behaviour is normal but obviously I haven’t camera…
version 3.8.1
Thank you…