I have a custom class called "Character" which is currently a subclass of Sprite. Up to this point I was using different image files to do all of my animations which ran great. I am now transitioning to one spritesheet and have run into a few issues.
When I used separate images it was essentially, load the animations and actions in the init then setup methods like this:
-(void) showCrash
{
if (self.status != @"Crashed")
{
[self setStatus:@"Crashed"];
[self stopAllActions];
[self runAction:crashAction];
}
}
and everything worked great.
Now with SpriteSheets, I have to use AtlasSpriteManager and actually have an AtlasSprite (called 'currentSprite' in my example) to run the actions like this:
-(void) showCrash
{
if (self.status != @"Crashed")
{
[self setStatus:@"Crashed"];
[self stopAllActions];
[self.currentSprite runAction:crashAction];
}
}
The problem is my animations are all 30x30 but the crash animation is 70x70. When I had different image files the current animation would be replaced by the crash animation and there wasn't an issue with size. Now with the spritesheet I am seeing that the crash animation has been shrunk to 30x30. What course of action should I take? Should I not be using a subclass of Sprite for my Character class? Does it matter? Is it because of the AtlasSprite I created in the init is only 30x30? Is there anyway for me to have my whole class be an AtlasSprite and I can continue to just do [self runAction:someAction]; I couldn't figure out how to do that and add AtlasSpriteManager to itself. It seems the order is create AtlasSpriteManager, create AtlasSprite, add AtlasSprite to AtlasSpriteManager then have that AtlasSprite do the actions.