title: Cocos2D checking if sprite is off screen?
body: <p>Im using this code to fire upwards: </p>
  
  <pre><code>- (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent* )event
  {
  
  //Spawn the bullet
  CCSprite * projectile = [CCSprite spriteWithFile:@"Projectile.png" rect:CGRectMake(0, 0,    17.5, 10)];
  projectile.position = ccp(donk.position.x , 50);
  [self addChild:projectile];
  
  //Actualy Fire
  [projectile runAction: [CCMoveTo actionWithDuration:.2 position: ccp (donk.position.x , 350)]];
  
  
  }
  </code></pre>
  
  <p>It works like I want but how can i use an if statement to check if the projectile it is off the top off the screen so I can remove it?</p>
  
  <p>I tried using this:</p>
  
  <pre><code>    if (projectile.position.y &gt;= 330) {
      CCLOG(@"Removed");
      [self removeChild:projectile cleanup:YES];
  }
  </code></pre>
  
  <p>but I forgot that touches ended is only called once.</p>