Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Why is that my newly added ball wont ? #277157
07/08/09 02:57
07/08/09 02:57
Joined: Jun 2009
Posts: 17
Cebu Philippines
U
uone Offline OP
Newbie
uone  Offline OP
Newbie
U

Joined: Jun 2009
Posts: 17
Cebu Philippines
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);
}

Re: Why is that my newly added ball wont ? [Re: uone] #277175
07/08/09 07:37
07/08/09 07:37
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
Both actions use the player-pointer, that's not good. Remove that pointer from one action, then see what's happening.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1