Hello GE,
How can I make a canvas draw all instances of a cloned actor, at the moment it is only drawing the first one and non of the others.
Thank you
int i;
char actor[50]; //String for actors name.
for (i = 0; i < ActorCount("clones"); i ++) //Check all clones through.
{
sprintf(actor, "clones.%i", i); //Set the name of actor to draw.
draw_from(actor, 0, 0, 1); //Draw it.
}
int i;
char actor[50]; //String for actors name.
for (i = 0; i < ActorCount("smile"); i ++) //Check all clones through.
{
sprintf(actor, "smile.%i", i); //Set the name of actor to draw.
draw_from(actor,200+actor.x-Player1.x, 200+actor.y-Player1.y, 1); //Draw it.
}
int i;
char buffer[50]; //String for actors name.
Actor* actor;
for (i = 0; i < ActorCount("smile"); i ++) //Check all clones through.
{
sprintf(buffer, "smile.%i", i); //Set the name of actor to draw.
actor=getclone(buffer);
if(actor!=NULL)
{
draw_from(actor->clonename,200+actor->x-Player1.x, 200+actor->y-Player1.y, 1); //Draw it.
}
}
char actorName[50];
Actor * GetClone(char Name[50], int num)
{
sprintf(actorName, "%s.%i", Name, num);
return getclone(actor);
}
int i;
Actor * this;
char actor[50]; //String for actors name.
for (i = 0; i < ActorCount("smile"); i ++) //Check all clones through.
{
this = GetClone("smile", i);
sprintf(actor, "smile.%i", i); //Set the name of actor to draw.
draw_from(actor,200+this->x-Player1.x, 200+this->y-Player1.y, 1); //Draw it.
}
Zehper48 wrote:skydereign, I tried using your code, Thanks so much for helping me out, I didn't get any errors, but my clones didnt appear in the canvas
Lcl,
when i enterd the method into the global code it said
undeclared identifier actor line 5
I attached my game, if you could take a look at it, i would greatly appriciate
Users browsing this forum: No registered users and 1 guest