Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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 | chip programmers | 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