46 hours to assignment submission

This is a discussion on 46 hours to assignment submission within the Game Programming forums, part of the General Programming Boards category; Hi all.....I'm currently assigned to develop a spaceship shooting game and it is supposed technically achievable within 30 hours. I ...

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

    46 hours to assignment submission

    Hi all.....I'm currently assigned to develop a spaceship shooting game and it is supposed technically achievable within 30 hours. I doubt I shall be getting much slleep the next 2 days......can u guys take a look at what the final product should look like here and the engine here and comment me on how I should take on this challenge. Much help is appreciated. Thanks a lot and have a nice day.

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    12
    i've done the spaceship rotation bit......i'm not sure how to thrust

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    12
    thrusting done...moving on to terrain n perhaps shooting...time left 44 hrs 20 mins

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    12
    terrain problem....when i run the game....the buildings appear for less than 1 second and then it is totally gone.......how come??

  5. #5
    Registered User
    Join Date
    Oct 2001
    Posts
    12
    Code:
    /class Terrain
    {
    private: double xCoord, yCoord;
    		 int type; //type of terrain from 0 to 4
    		 MySurface* pMySurface;
    		 
    		 RECT sourceRect, destRect;
    		 double width, height;
    
    public:
    	Terrain(int t, double x1,MySurface* p)
    	{
    		xCoord = x1;
    		yCoord = 0.0;
    		type = t;
    		pMySurface = p;
    		//calculate column and row number of the image
    		double x,y;
    		switch(type)
    		{
    		case 0: x=0;width=128;y=124;height=132;break;
    		case 1: x=129;width=61;y=35;height=221;break;
    		case 2: x=270;width=100;y=185;height=71;break;
    		case 3: x=383;width=97;y=205;height=51;break;
    		case 4: x=500;width=140;y=230;height=26;break;
    		case 5: x=191;width=75;y=35;height=221;break;
    		}
    		sourceRect.top=(int)y;
    		sourceRect.bottom=(int)(y+height);
    		sourceRect.left=(int)x;
    		sourceRect.right=(int)(x+width);
    		LogError("sourceRect");
    		LogError(x);
    		LogError(x+width);
    	}
    	double getX()
    	{
    		return xCoord;
    	}
    	double getWidth()
    	{
    		return width;
    	}
    
    
    	int getType()
    	{
    		return type;
    	}
    	void setType(int t)
    	{
    		type = t;
    	}
    	void draw()
    	{
    		destRect.top = (int)(470-gdViewpointY-height);
    		destRect.bottom= (int)(600-gdViewpointY);
    		destRect.left  = (int)(xCoord-gdViewpointX);
    		destRect.right=(int)(xCoord+width-gdViewpointX);
    	/*destRect.left=(int)xCoord-gdViewpointX+100;
    			destRect.right=(int)xCoord+width-gdViewpointX;
    			destRect.bottom=(int)600-gdViewpointY;
    			destRect.top=(int)470-gdViewpointY;*/
    		LogError("destRect");
    		LogError(destRect.left);
    		LogError(destRect.right);
    		//to copy from secondary surface to back buffer
    		pDrawEngine->Blit(destRect,sourceRect,pMySurface);
    	}
    };
    Terrain* terrainArr[NUMOFTERRAIN];
    int GameInit()
    {
    .....
    srand(time(NULL));
    double x=0.0;
    terrainArr[0] = new Terrain(rand()%5,x,pgTerrainSurface);
    LogError(terrainArr[0]->getType());
    x+=terrainArr[0]->getWidth();
    for(int i=1;i<NUMOFTERRAIN;i++)
    {
    	terrainArr[i] = new Terrain(rand()%5,x,pgTerrainSurface);
    	LogError(terrainArr[i]->getType());
    	x+=terrainArr[i]->getWidth();
    	LogError(x);
    }
    count = 1;
    x =0.0;
    widthDrawn = 0.0;
    .....
    }
    int GameMain{
    ...
    DrawTerrain()
    .....}
    void DrawTerrain()
    {
    	//if(count==NUMOFTERRAIN)
    	//count=0;
    	widthDrawn = 0.0;
    	for(int i=count;i<NUMOFTERRAIN;i++)
    	{
    		LogError("inside for loop in terrain");
    		terrainArr[i]->draw();
    		widthDrawn+=terrainArr[i]->getWidth();
    		count++;
    		if(widthDrawn>=SCREENWIDTH)
    		{
    			LogError("widthDrawn>=SCREENWIDTH");
    			widthDrawn = 0;
    			break;
    		}
    	}
    }

  6. #6
    Registered User
    Join Date
    Oct 2001
    Posts
    12
    Code:
    /class Terrain
    {
    private: double xCoord, yCoord;
    		 int type; //type of terrain from 0 to 4
    		 MySurface* pMySurface;
    		 
    		 RECT sourceRect, destRect;
    		 double width, height;
    
    public:
    	Terrain(int t, double x1,MySurface* p)
    	{
    		xCoord = x1;
    		yCoord = 0.0;
    		type = t;
    		pMySurface = p;
    		//calculate column and row number of the image
    		double x,y;
    		switch(type)
    		{
    		case 0: x=0;width=128;y=124;height=132;break;
    		case 1: x=129;width=61;y=35;height=221;break;
    		case 2: x=270;width=100;y=185;height=71;break;
    		case 3: x=383;width=97;y=205;height=51;break;
    		case 4: x=500;width=140;y=230;height=26;break;
    		case 5: x=191;width=75;y=35;height=221;break;
    		}
    		sourceRect.top=(int)y;
    		sourceRect.bottom=(int)(y+height);
    		sourceRect.left=(int)x;
    		sourceRect.right=(int)(x+width);
    		LogError("sourceRect");
    		LogError(x);
    		LogError(x+width);
    	}
    	double getX()
    	{
    		return xCoord;
    	}
    	double getWidth()
    	{
    		return width;
    	}
    
    
    	int getType()
    	{
    		return type;
    	}
    	void setType(int t)
    	{
    		type = t;
    	}
    	void draw()
    	{
    		destRect.top = (int)(470-gdViewpointY-height);
    		destRect.bottom= (int)(600-gdViewpointY);
    		destRect.left  = (int)(xCoord-gdViewpointX);
    		destRect.right=(int)(xCoord+width-gdViewpointX);
    	/*destRect.left=(int)xCoord-gdViewpointX+100;
    			destRect.right=(int)xCoord+width-gdViewpointX;
    			destRect.bottom=(int)600-gdViewpointY;
    			destRect.top=(int)470-gdViewpointY;*/
    		LogError("destRect");
    		LogError(destRect.left);
    		LogError(destRect.right);
    		//to copy from secondary surface to back buffer
    		pDrawEngine->Blit(destRect,sourceRect,pMySurface);
    	}
    };
    Terrain* terrainArr[NUMOFTERRAIN];
    int GameInit()
    {
    .....
    srand(time(NULL));
    double x=0.0;
    terrainArr[0] = new Terrain(rand()%5,x,pgTerrainSurface);
    LogError(terrainArr[0]->getType());
    x+=terrainArr[0]->getWidth();
    for(int i=1;i<NUMOFTERRAIN;i++)
    {
    	terrainArr[i] = new Terrain(rand()%5,x,pgTerrainSurface);
    	LogError(terrainArr[i]->getType());
    	x+=terrainArr[i]->getWidth();
    	LogError(x);
    }
    count = 1;
    x =0.0;
    widthDrawn = 0.0;
    .....
    }
    int GameMain{
    ...
    DrawTerrain()
    .....}
    void DrawTerrain()
    {
    	//if(count==NUMOFTERRAIN)
    	//count=0;
    	widthDrawn = 0.0;
    	for(int i=count;i<NUMOFTERRAIN;i++)
    	{
    		LogError("inside for loop in terrain");
    		terrainArr[i]->draw();
    		widthDrawn+=terrainArr[i]->getWidth();
    		count++;
    		if(widthDrawn>=SCREENWIDTH)
    		{
    			LogError("widthDrawn>=SCREENWIDTH");
    			widthDrawn = 0;
    			break;
    		}
    	}
    }

  7. #7
    Registered User
    Join Date
    Oct 2001
    Posts
    12
    the funny thingis that i can see like 8 buildings if i comment the count++ in the void DrawTerrain().....

  8. #8
    Registered User
    Join Date
    Dec 2002
    Posts
    221
    none of ur links work there homie

  9. #9
    King of the Internet Fahrenheit's Avatar
    Join Date
    Oct 2001
    Posts
    128
    I'm glad you are keeping us updated. 6 replies to yourself? Jesus...

  10. #10
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    I've seen doubles,
    I've seen triple,
    but never have I seen a sexpost!

    sorry, couldn't resist

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 04-26-2009, 08:54 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Replies: 1
    Last Post: 10-27-2006, 01:21 PM
  4. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 03:56 PM
  5. Time between Military Hours
    By StarOrbs in forum C++ Programming
    Replies: 18
    Last Post: 03-01-2005, 05:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21