Jump to content
  • Advertisement
Sign in to follow this  
unfinished

Platform Games

This topic is 4956 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am look for some advice aboout the best way of creating the screen using OpenGL. I have written a quick program just to test how well it works, I am generating 20*15 quads and applying textures to them. I want to then add another layer infront, for things like platforms, I hope this will make collision easier? Am I just doing this the hard way. Can someone suggest a source for graphics/textures for games as I am no artist.
int LevelBoxDraw()
{
	int	n=0;
	
	glTranslatef(-42.0f,-28.0f,-74.0f);					// Move Left 
	glColor3f(1.0f,1.0f,1.0f);							// Set The Color To Blue One Time Only
	glBindTexture(GL_TEXTURE_2D, texture[0]);			// Select Our Texture
	

	for (float y = 0; y <= 14; y++)				//   Add one to take into account the loop
	{
		for (float x = 0; x <= 19; x++)
		{
//			glBindTexture(GL_TEXTURE_2D, texture[0]);			// Select Our Texture
			glBindTexture(GL_TEXTURE_2D, texture[LevelData[n++]-48]);			// Select Our Texture
			glTranslatef(4.0f,0.0f,0.0f);						// Move Right 3 Units
			glBegin(GL_QUADS);									// Draw A Quad
			glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.0f, -2.0f,  1.0f);	// Bottom Left Of The Texture and Quad
			glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.0f, -2.0f,  1.0f);	// Bottom Right Of The Texture and Quad
			glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.0f,  2.0f,  1.0f);	// Top Right Of The Texture and Quad
			glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.0f,  2.0f,  1.0f);	// Top Left Of The Texture and Quad
			glEnd();											// Done Drawing The Quad
		}
		glTranslatef(-x*4,4.0,0.0f);						// Move Right 3 Units
		glColor3f(1.0f,1.0f,1.0f);							// Set The Color
	}
	return	TRUE;
}

I took the original code form lesson3 and modified as I went. Question about textures what is the minimum size that be used, I know that the have to be a power of 2. thanxs

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!