Possible to remove part of sprite that player contacts?


If I have a character that is running through a tilemap, is it possible to only remove (or setvisible(false)) only the portions of the sprite that they come into contact with?

Thanks in advance!



You can cut a Sprite using CCRectMake with setTextureRect.
More or less:

CCRect newRect = CCRectMake(_mySprite->getTextureRect().origin.x,_mySprite->getTextureRect().origin.y,_newWidth,_mySprite->getContentSize().height);

This cuts the sprite horizontally from right to left