technoXavage
12-18-2003, 02:23 PM
class Helicopter3
{
public:
double xcoordinate;
double ycoordinate;
double verticalspeed;
double horizontalspeed;
double xcoordinate2;
double ycoordinate2;
double verticalspeed2;
double horizontalspeed2;
int sc;
RECT destRect, sourceRect;
RECT destRect2,sourceRect2;
RECT destRect3,sourceRect3;;
RECT destRect4,sourceRect4;
MySurface* pHeli;
public:
Helicopter3(int a1, int a2,int a3,int a4,MySurface* p )
{
xcoordinate=a1;
ycoordinate=a2;
verticalspeed=a3;
horizontalspeed=a4;
pHeli = p;
}
void move();
void draw();
void die();
};
void Helicopter3::move()
{
if(counter==0)
{
sourceRect.top = 0;
sourceRect.bottom = 31;
sourceRect.left = 0;
sourceRect.right = 63;
counter++;
}
else if (counter==1){
sourceRect.top = 0;
sourceRect.bottom = 31;
sourceRect.left = 64;
sourceRect.right = 127;
}
else if(counter==2){
sourceRect.top = 0;
sourceRect.bottom = 31;
sourceRect.left = 128;
sourceRect.right = 191;
}
/* if (xcoordinate<=gdViewpointX+748&&xcoordinate-63>gdViewpointX-50)
{ destRect.right=xcoordinate-gdViewpointX+50;
destRect.left=destRect.right-63;
destRect.bottom=ycoordinate;
destRect.top=ycoordinate-31;}*/
destRect.left=300;
destRect.right=300+63;
destRect.top=300;
destRect.bottom=300+31;
pDrawEngine->Blit(destRect,sourceRect,pHeli);
}Helicopter3* heliArr[100];
int GameInit(){
pHeli = new MySurface(pDrawEngine->lpdd);
pHeli->LoadBitmap("chopper.bmp");
}
heliArr[0] = new Helicopter3(300,300,0,0,pHeli);
int GameMain(){
DrawTerrain();
}
void DrawTerrain()
{
/*for(int i=0;i<200;i++)
{
}*/
heliArr[0]->move;
}
can some tell me why my helicopter is not blitting?? issit that i have problem passing in when i use the constructor?? but i hard code the coordinates but it still did not blit.....i dunno why but i seem to be having a big problem with arrays tonight; can't do my bulding terrain and helicopter foes without it...some 1 help...bubba??
{
public:
double xcoordinate;
double ycoordinate;
double verticalspeed;
double horizontalspeed;
double xcoordinate2;
double ycoordinate2;
double verticalspeed2;
double horizontalspeed2;
int sc;
RECT destRect, sourceRect;
RECT destRect2,sourceRect2;
RECT destRect3,sourceRect3;;
RECT destRect4,sourceRect4;
MySurface* pHeli;
public:
Helicopter3(int a1, int a2,int a3,int a4,MySurface* p )
{
xcoordinate=a1;
ycoordinate=a2;
verticalspeed=a3;
horizontalspeed=a4;
pHeli = p;
}
void move();
void draw();
void die();
};
void Helicopter3::move()
{
if(counter==0)
{
sourceRect.top = 0;
sourceRect.bottom = 31;
sourceRect.left = 0;
sourceRect.right = 63;
counter++;
}
else if (counter==1){
sourceRect.top = 0;
sourceRect.bottom = 31;
sourceRect.left = 64;
sourceRect.right = 127;
}
else if(counter==2){
sourceRect.top = 0;
sourceRect.bottom = 31;
sourceRect.left = 128;
sourceRect.right = 191;
}
/* if (xcoordinate<=gdViewpointX+748&&xcoordinate-63>gdViewpointX-50)
{ destRect.right=xcoordinate-gdViewpointX+50;
destRect.left=destRect.right-63;
destRect.bottom=ycoordinate;
destRect.top=ycoordinate-31;}*/
destRect.left=300;
destRect.right=300+63;
destRect.top=300;
destRect.bottom=300+31;
pDrawEngine->Blit(destRect,sourceRect,pHeli);
}Helicopter3* heliArr[100];
int GameInit(){
pHeli = new MySurface(pDrawEngine->lpdd);
pHeli->LoadBitmap("chopper.bmp");
}
heliArr[0] = new Helicopter3(300,300,0,0,pHeli);
int GameMain(){
DrawTerrain();
}
void DrawTerrain()
{
/*for(int i=0;i<200;i++)
{
}*/
heliArr[0]->move;
}
can some tell me why my helicopter is not blitting?? issit that i have problem passing in when i use the constructor?? but i hard code the coordinates but it still did not blit.....i dunno why but i seem to be having a big problem with arrays tonight; can't do my bulding terrain and helicopter foes without it...some 1 help...bubba??