Hi,

I am making a game that would add a ball when a player ball hit to a brick object but why is it that the newly added ball's behavior is not the same with the player ball because if the added ball hits the wall it wont bounce. What is wrong with my code? some advice please?

by the way here is my code:


// function : moves the added ball
//--------------------------------------------------------------------------------------
action move_ball()
{
wait(1);
ballsInField += 1;
player = me;
my.emask |= (ENABLE_BLOCK | ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_DETECT);// | FLAG2 ); // the object is sensitive to block and entity collisions
my.event = bounce_off;
my._ball = 10;


while(1)
{
c_move(me,vector(-30*time_step,0,0),nullvector,IGNORE_PASSABLE | GLIDE | IGNORE_FLAG2 | ACTIVATE_PUSH);


if (my.x < ent_catcher.x)
{
ballsInField -= 1;
reset(my, SHOW);
wait(2);
break;
}
wait(1);
}
ent_remove(me);


}




//function: moves the original ball from the start of the game
//-------------------------------------------------------------------------------------------
action act_ball(){

ballsInField+=1;

player = me;
// c_setminmax(me);
// set(me, POLYGON);
my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY); // the object is sensitive to block and entity collisions
my.event = bounce_ball;
my._ball = 10;
my.z= player.z;
while(!player){wait(2);}
while(!ent_catcher){wait(1);}

while(1)
{

c_move(me,vector(30*time_step,0,0),nullvector,IGNORE_PASSABLE | GLIDE | IGNORE_FLAG2 | ACTIVATE_PUSH);

if(my.x < ent_catcher.x )
{

wait(1);
reset(my, SHOW);
vec_set(my.x, vector(-235,-12,0));
vec_set(my.pan, vector(0,0,0));
waiter = 375;

ballsInField-=1;

if(ballsInField<1)
{
ballLives-=1;
if(ballLives<1)
{
break;
}
}
if(ballLives>0)
{
ballsInField+=1;
}
}

while(waiter != 0)
{

// vec_set(my.x,vector(ent_catcher.x+75, ent_catcher.y-20, ent_catcher.z));
vec_set(my.x,vector(ent_catcher.x+85, ent_catcher.y-20, ent_catcher.z));
waiter -= 1;
change_dis (waiter/90);
wait(1);
}


wait(1);
}
ent_remove(my);
}