M
Mike
Hi
below how/where do i initialize the array? pos[4][4] = { x,y };
How can I then access and write to positions within the array?
Many thanks
Michael
---------
class droplet
{
private:
int pos[4][4];//location of drop head on screen
int trail[16];//information on all characters
int speed;//speed, 1, 2 or 3.
public:
droplet(int x, int y, int spd);
~droplet();
void draw();
void down();
};
droplet::droplet(int x, int y, int spd){
int i=0;
while(i<16){
// for (x=0; x<4; x++)
// for (y=0; y<4; y++)
// {
pos[4][4] = { x,y };
// }
trail = 32+rand()%223;
i++;
}
// pos.Y=y;
speed=spd;
}
droplet::~droplet(){
// for(int i=0;i<16;i++) delete drops;//destorying droplets
// delete[] drops;//destroying droplet pointer array
}
below how/where do i initialize the array? pos[4][4] = { x,y };
How can I then access and write to positions within the array?
Many thanks
Michael
---------
class droplet
{
private:
int pos[4][4];//location of drop head on screen
int trail[16];//information on all characters
int speed;//speed, 1, 2 or 3.
public:
droplet(int x, int y, int spd);
~droplet();
void draw();
void down();
};
droplet::droplet(int x, int y, int spd){
int i=0;
while(i<16){
// for (x=0; x<4; x++)
// for (y=0; y<4; y++)
// {
pos[4][4] = { x,y };
// }
trail = 32+rand()%223;
i++;
}
// pos.Y=y;
speed=spd;
}
droplet::~droplet(){
// for(int i=0;i<16;i++) delete drops;//destorying droplets
// delete[] drops;//destroying droplet pointer array
}