Array Problem
in
Programming Questions
•
1 year ago
i am trying to make a bounce class an instance veriable of the ball class but im getting the error
can someone help me that how to make the bounce array a instance veriable of the ball array. i am having difficulty making it
or can someone tell me how to associate one array as an instance veriable of another array. the format will stay the same.
thanks
Bounce[] bnce;
class Bounce{
int x,y,w,h;
Bounce (int b1, int b2, int b3, int b4){
x = b1;
y = b2;
w = b3;
h = b4;
}
}
ball[] f;
class ball{
int x,y,w,h,dir,r,g,b,Bounce[];
float speed,boost;
ball(int p1,int p2,int p3,int p4,int p5,int p6,int p7,int p8,float p9){
x = p1;
y = p2;
w = p3;
h = p4;
dir = p5;
r = p6;
g = p7;
b = p8;
speed = p9;
boost = 0; //initially zero
bnce[i] ;
}
}
can someone help me that how to make the bounce array a instance veriable of the ball array. i am having difficulty making it
or can someone tell me how to associate one array as an instance veriable of another array. the format will stay the same.
thanks
Bounce[] bnce;
class Bounce{
int x,y,w,h;
Bounce (int b1, int b2, int b3, int b4){
x = b1;
y = b2;
w = b3;
h = b4;
}
}
ball[] f;
class ball{
int x,y,w,h,dir,r,g,b,Bounce[];
float speed,boost;
ball(int p1,int p2,int p3,int p4,int p5,int p6,int p7,int p8,float p9){
x = p1;
y = p2;
w = p3;
h = p4;
dir = p5;
r = p6;
g = p7;
b = p8;
speed = p9;
boost = 0; //initially zero
bnce[i] ;
}
}
1