I have the Y axis increasing very few frames with the following line:
Bullets.center = CGPointMake(Airplane.center.x, Airplane.center.y + Y);
How can I stop increasing Y when an if statement is true?
I have the Y axis increasing very few frames with the following line:
Bullets.center = CGPointMake(Airplane.center.x, Airplane.center.y + Y);
How can I stop increasing Y when an if statement is true?
Basically, I'd say "don't add Y if the statement is true", but I may be misunderstanding your question, it seems quite simple. A ternary operator in the CGPointMake will take care of it:
Bullets.center
= CGPointMake(Airplane.center.x, Airplane.center.y + (CONDITION ? 0 : Y));