Guys:
I have a weird issue going on in my game.
Here is the situation.
a) I have a sprite which has pretty much all game objects.
b) this sprite gets added as a child to main Game Object when the game starts.
c) In the sprite I have an image of 3 boy/girl. Each one of them has a custom Initial Position property which stores their initial position.
Here is the situation: When the game starts the three actors are placed in expected coordinates ( not an issue) but when I'm done running a tween and after the tween finishes, I execute resetPosition which essentially does this:
-(void) resetPosition
{
self.x = initialPosition.x;
self.y = initialPosition.y;
}
The objects don't come back to their initial positions, they go every where but the initial position.
The code to create the actors is like this:
if (self = [super init])
{
atlas = textureAtlas;
SPTextureAtlas *imageAtlas = [SPTextureAtlas atlasWithContentsOfFile:textureAtlas];
if (imageAtlas)
{
NSArray *textures = [imageAtlas texturesStartingWith:nameType];
draggableMovieClip = [[SPMovieClip alloc]initWithFrames:textures fps:3];
draggableMovieClip.loop = NO;
[draggableMovieClip addEventListener:@selector(onMovieClipCompleted:) atObject:self forType:SP_EVENT_TYPE_MOVIE_COMPLETED];
[draggableMovieClip setSound:[[SPSound soundWithContentsOfFile:soundFile]createChannel] atIndex:1];
[self addChild:draggableMovieClip];
collisionQuad = quad;
initialPosition = [SPPoint point];
initialPosition.x = point.x;
initialPosition.y = point.y;
self.x = point.x;
self.y = point.y;
}
}
return self;
point in this case is : (210, 510), (500, 510), (880, 510).
The game is Landscape only.
Any help is highly appreciated.