Thread: class Array seem to be not workin..pls help

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    12

    class Array seem to be not workin..pls help

    Code:
    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??

  2. #2
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    >>heliArr[0]->move;

    Forgot your () there...Maybe it was just a typo? Could be the problem, but I don't think it would compile
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Class Template Trouble
    By pliang in forum C++ Programming
    Replies: 4
    Last Post: 04-21-2005, 04:15 AM
  2. Animation class not working
    By VirtualAce in forum Game Programming
    Replies: 5
    Last Post: 03-02-2005, 06:48 AM
  3. Hi, could someone help me with arrays?
    By goodn in forum C Programming
    Replies: 20
    Last Post: 10-18-2001, 09:48 AM
  4. Replies: 4
    Last Post: 09-12-2001, 02:05 PM