this is my first question i hope its just not too stupid, i've searched but couldn't find an answer, i hope you can help me!
I create and add to my scene an SKSpriteNode, then i want to be able to know its current position in the method TouchesBegan, then use a condition depending on its current position.
-(id)initWithSize:(CGSize)size {
if (self = [super initWithSize:size]) {
SKSpriteNode *miChar = [self createCharacter];
[self addChild: miChar];
}
Here is just the simple way to add it to my scene, then i want to know miChar.position.y for example when TouchesBegan
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
//Here is where i need the position of miChar.position.y
SKSpriteNode *currentPos=miChar.position.y;
while(currentPos.position.y > miChar.position.y){
/* i want to do things here until the position is above for example
miChar is an SKSpriteNode that is on constant movement so i need to check its
position wich will be constantly changing*/
}
Well, this is it, may be so simple or just not possible to do this way.. im sorry just started coding. Thanks for your time guys!