I want output the information of all actes in my game to txt file.How can I get the actes' information? Use the "getclone" function? But, which type is the fuction's return value?
thanks very much .
Actor * this =getclone("enemy.1");
int xx=this->x;
Actor * this =getclone("enemy.1");
char thisactor[32];
strcpy(thisactor, this->clonename);
DestroyActor(thisactor);
Actor *getclone2 ( char *actorName, long cloneNumber )
{
char resultString[256] = "";
char cloneNumberAsString[10];
Actor *resultActor;
strcpy ( resultString, actorName );
strncat ( resultString, ".", 1 );
sprintf (cloneNumberAsString, "%i", cloneNumber);
strncat ( resultString, cloneNumberAsString, 10 );
resultActor = getclone(resultString);
return resultActor;
}
Actor *getclone3(char *actorName, long cloneIndex)
{
char cloneName[256];
sprintf(cloneName,"%s.%d",actorName,cloneIndex);
return (getclone(cloneName));
}
void draw_from_clone(char *actorName,long cloneIndex,float x, float y,float scale)
{
char cloneName[256];
sprintf(cloneName,"%s.%d",actorName,cloneIndex);
draw_from(cloneName,x,y,scale);
}
void paintCanvas()
{
int i;
char cloneName[256];
for (i=0;i<ActorCount("bg");i++)
{
sprintf(cloneName,"bg.%d",i);
draw_from(cloneName,view.width/2,view.height/2+i,z[i]);
}
}
Users browsing this forum: No registered users and 1 guest