Advertisement

plane game

Started by October 16, 2019 01:13 AM
3 comments, last by fleabay 4 years, 11 months ago

 


void drawcollision_one()
{
	glEnable(GL_TEXTURE_2D);

	glBindTexture(GL_TEXTURE_2D, texture[3]);

	glBegin(GL_POLYGON);
	glTexCoord3f(0.0f + screen, 0.0f, 0.0f);

	glVertex3f(0.5f, -0.5f, 0.0f);
	glTexCoord3f(0.167f + screen, 0.0f, 0.0f);

	glVertex3f(0.5f, 0.5f, 0.0f);
	glTexCoord3f(0.167f + screen, 1.0f, 0.0f);

	glVertex3f(-0.5f, 0.5f, 0.0f);
	glTexCoord3f(0.0f + screen, 1.0f, 0.0f);

	glVertex3f(-0.5f, -0.5f, 0.0f);
	glEnd();

	glDisable(GL_TEXTURE_2D);
}

void timer(int val)
{
	screen += 0.1667f;
	if (screen >= 1.0f)
	{
		screen = 1.0f;
	}
	glutPostRedisplay();
	glutTimerFunc(500, timer, 0);
}

void coll_plane_one()
{
	//draw bullet
	float x = 5.0f+horizontal_one;
	float y = 0.0f+vertical_one;
	float oWidth = 0.125f;
	float oHeight = 0.125f;
	//draw plane
	float xTwo = -5.0f+horizontal+up_two;
	float yTwo = 0.0f+vertical;
	float oTwoWidth = 1.0f;
	float oTwoHeight = 1.0f;

	if (checkCollide(x, y, oWidth, oHeight, xTwo, yTwo, oTwoWidth, oTwoHeight) == 1)
	{
		drawcollision_one();
	}
}

I hope it is ok if I go back to my plane game that I started on last  year. I am  using a collision function to call  a collision function but it does not call the collision function properly. when the bullet hits the enemy ship it does not display the collision function.

 

 

Phil is the hardest working troll I've ever been around.

 

Hall of Fame stuff.

 

Good job.

 

 

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

Advertisement

thanks

1 hour ago, phil67rpg said:

I am  using a collision function to call  a collision function but it does not call the collision function properly.

You need another level of abstraction.

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

This topic is closed to new replies.

Advertisement