objective c - How to pass 2 parameters with a self method Cocos2d -


this noobish question has been answered before, can't seem find solution online (google not being friendly). question is, relating cocos2d, how pass 2 parameters using self method. example of code

-(void)random {     [self aicharacter:theevilone];     [self aicharacter:theeviltwo]; }  -(void)aicharacter(ccsprite*)evilcharacter {     //stuff } 

but want following

-(void)random {     num = 1     [self aicharacter:theevilone, num];     num = 2     [self aicharacter:theeviltwo, num]; }   -(void)aicharacter:(ccsprite*)evilcharacter (nsinteger*)num { //this line seems incorrectly formatted/syntactically incorrect.      //stuff } 

to give more info doing have multi-dimensional array of values relating separate ai characters , have num value differentiate rows pertaining each sprite.

try

-(void)random {    num = 1    [self aicharacter:theevilone: num];    num = 2    [self aicharacter:theeviltwo: num];  }  -(void)aicharacter:(ccsprite*)evilcharacter :  (nsinteger*)num {   //this line seems incorrectly formatted/syntactically incorrect.   //stuff  } 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -