I’m trying to make a simple game and I am currently trying to make an arrow shoot out.
So far I have two functions,
-(void)ccTouchesBegan
Touches began does some math and gets a vector from the initial shooting point of arrow and the thumbpress, then passes this data into another function:
-(void)shatArrow:(CGPoint)cl:(CGPoint)nv{
}
What I want is for the shatArrow function to call a ccTime function that runs solely for the purpose of making the arrow move, and once the arrow is done with it’s projection, the ccTime function will stop, and can be called again later when needed.
How would I go about this?
Schedule the update selector (ie in the init method of your class):
Then implement the update method:
You can keep the update method running, unless you have hundreds of arrows it won’t affect performance.
Btw, it’s “shoot, shot, shot” and not “shoot, shot, shat” or something like that. (I suppose you didn’t ask for a #LinguisticsOverflow answer) 😉