Hi
I'm trying to make a game with split screen but if i shoot bullets they doesn't appears on the splited screen.
Please help!I use draw_from to make in split screen.
bulletcount ++;
bulletcount --;
int i;//needed for loop
erase(0, 0, 0, 1);
for(i=0; i < bulletcount; i++)//loop through all the bullets
{
Actor * this = getclone2("bullet", i);//so we can use pointers for x & y, can't do bullet.i.x
draw_from("bullet.i", 320+this->x-p1.x, 160+this->y-p1.y, 1);//draw that bullet
}
int i;
erase(0, 0, 0, 1);
for(i=0; i < bulletcount; i++)
{
Actor * this = getclone2("bullet", i);
draw_from("bullet.i", 320+this->x-p2.x, 160+this->y-p2.y, 1);
}
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*
getclone2(char* actor_name, int c_index)
{
char buffer[30];
sprintf(buffer, "%s.%d", actor_name, c_index);
return (getclone(buffer));
}
Users browsing this forum: No registered users and 1 guest