At the last line: “firstSprite = secondSprite;”, I tried to “copy” the secondSprite to the firstSprite but nothing changes. Cocos2d-x shows me two different sprites again. What I do wrong?
Perhaps you should read a bit about pointers in C++ to have a better understanding of how things works.
That said, there are several things you may want to do :
change the texture. Lance’s code do just that. I would have used the getTexture/setTexture methods, not sure it works either.
copy all the sprite properties. In that case, you have to either copy one by one every property, or use the copy() method, but I’m not sure that method is properly implemented for that kind of usage.